Jeff-Mott-OR/javascript-cpp-rosetta-stone

Native C/C++ variadic functions

Closed this issue · 3 comments

Hello,

Nice stone !

Why not using native C/C++ variadic functions in the Variadic functions section ?

I'm considering mentioning C++ variadic templates, but we should almost certainly avoid C-style variadic functions. C-style variadic functions don't allow arguments to be user-defined types, and they're not type-safe.

Variadic templates seems in fact a better choice. I didn't know about them, last time I used C++ was 5 years ago and I still have a lot to catch from C++11 (and C++14).
Do you want me to close the issue or do you want to keep it as a reminder ?

Decided not to do this because the goal of this write-up is to gain insights into JavaScript's inner workings, and a vector<any> parameter named arguments reflects how JavaScript behaves.