4 ms·
Fair enough, I agree that it isn't the prettiest or most natural of code but it isn't any "magic" too far beyond convention. Without C++ templates this is the o
by orangeduck 15y ago
Fair enough, I agree that it isn't the prettiest or most natural of code but it isn't any "magic" too far beyond convention. Without C++ templates this is the only way to achieve certain things - and is fairly standardized.
See va_args for an example of naked types being passed in the standard library. Really it is not much different from the fact you have to pass a format string to printf.
- unwind 15y agoThat's true, I had forgotten about va_arg()'s use of naked types. I do think the standard library has a bit more license to do weird stuff, and it's fairly well-known that va_* can be macros.