
Andrey Semashev wrote:
On 03/06/2010 10:03 PM, Phil Richards wrote:
My point was that there is no need for having both overloads: it doesn't (as far as I can see) provide any benefit having an "efficient" const char* call - there isn't any (obvious) extra conversions or code bloat by providing just the const std::string& interface because internally the const char* are immediately converted to std::string.
But, as I said before, I might be missing something.
I didn't analyze the code deeply but the code bloat may take place because the function gets called from user's code multiple times. This means that the literal -> string conversion is generated many times in user's code instead of being generated once in the compiled binary of Boost.ProgramOptions. Again, I didn't ensure that is the case.
This is indeed the case. - Volodya