21 May
2013
21 May
'13
9:29 p.m.
Nathan Crookston wrote:
James Hirschorn wrote:
I believe when you have an optional constructor parameter, you must access it with the default value supplied:
struct myclass_impl { template <class ArgumentPack> myclass_impl(ArgumentPack const& args) { std::cout << "name = " << args[_name | ""] << "; index = " << args[_index | 0] << std::endl; } };
(Note the bitwise or "|"). This is a little different than for named function parameters, it seems.
HTH, Nate
Yes, that works. I should have checked here before making the report... Thanks, James