4 ms·
btw: you can actually write, for example, the first function as just: auto first(auto... params) { return params...[0]; } Unless I'm missing something - b
by joe91 2y ago
btw: you can actually write, for example, the first function as just:
auto first(auto... params) { return params...[0]; }
Unless I'm missing something - but the post is showing off the fact that you can index into the list of types of the parameters, as well as the parameters themselves (in which case you need full template syntax).
- rurban 2y agoWhat I said. ... as type and identifier suffix is just nonsense. A proper language would have used ... to designate varargs, and a special identifier to hold these args. Just as the macro preprocessor.