How to create a variant of re-sizeable and fixed size containers

I have a class whose underlying data is a variant of std::vector, std::unique_ptr and std::deque. This is shown in the code below. template<class T> class matrix2d { private: typename std::variant<std::vector<T>, std::unique_ptr<T[]>, std::deque<T>> data; public: matrix2d<T>() = delete; matrix2d<T>(size_t h, size_t w, int type) { try { switch (type) { case 0: data = std::vector<T>(h*w); break;…

Details

Send a message to discord channels via google apps script

I am using some scripts to send message to discord via google apps script… I used a function such as : function postMessageToDiscord(){ message = “Hello World!”; var discordUrl = “https://discordapp.com/api/webhooks/XXXXX”; var payload = JSON.stringify({content: message}); var params = { headers: { ‘Content-Type’: ‘application/x-www-form-urlencoded’ }, method: “POST”, payload: payload, muteHttpExceptions: true }; var response =…

Details