Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <string.h>
- #include <stdio.h>
- std::string arg;
- template<typename T>
- T add(T arg_){
- return arg_;
- }
- template<typename T, typename... Args>
- T add(T arg_, Args... args) {
- char* str_cast = strdup(arg_);
- strcat(str_cast, " ");
- return strcat(str_cast, add(args...));
- }
- template <typename... Args>
- void set_args(Args... args) noexcept {
- arg += add(args...);
- }
- int main() {
- set_args("-O3", "-fsanitize=leak");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment