
7 Mar
2010
7 Mar
'10
5:36 p.m.
vicente.botet skrev:
What about having both overloads? const char * is the best for literals, while string cont& is the best for strings variables.
void option_description::set_name(string const&_name); void option_description::set_name(const char* _name);
If the current implementation uses a temporary string, it needs just to forward the call.
void option_description::set_name(const char* _name) { std::string name(_name); option_description::set_name(name); }
I'm satisfied with this approach, and I also think it is the right approach. -Thorsten