6 ms·
There are templates: for example void print1(auto x){std::cout<< x;} is a function template template <class T> void print1(T x){std::cout<< x;}
by adsofhoads 10y ago
There are templates: for example
void print1(auto x){std::cout<< x;}
is a function template
template <class T>
void print1(T x){std::cout<< x;}
This is not valid C++14 however, so it doesn't compile. If you replace these, you'll probably still get a stack overflow while expanding the templates because there are almost 7000 arguments to a single function call.
- FrozenVoid 10y ago>This is not valid C++14 however, so it doesn't compile. It is "valid C++" IF there are fewer arguments, like 6-10 The example illustrates C++ internal representation of "variadic functions".
- adsofhoads 10y agoI was referring to the use of generic functions (ie. with an argument with type-specifier auto) which is not C++14. Your copy of g++ may accept it as an extension.
- KayEss 10y agoAnd that works if you use the old C style variadic functions?I suppose I see no reason why it wouldn't, but that isn't the same.