This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Genereric solution - see implementations below | |
| // Avoids recursion | |
| template<typename... Types> | |
| void unpack(Types... args) { | |
| auto a = {args...}; // <a> becomes an initializer_list of type <Types> | |
| // here we know all the input arguments | |
| // no need for va_start etc :) | |
| } | |
| // Example implementation - sum |