Boost logo

Boost :

Subject: Re: [boost] [program_options]
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2010-03-07 12:36:46


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk