In Javascript or ActionScript it’s possible to pass an object to a function or a constructor.
myfunction({myParam:1, myOtherParam:"hello"});
It is very useful when you have a lot of parameters to pass, IMO it makes using functions easier than using the classic approach.
myFunction(1,"hello");
Is there something similar in C++?
TIA
You can use the “named parameter idiom”:
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.20
Which would make your call look like:
See here for a comparison with Boost parameter.