Emre Turkay
I wonder if there is a downside of adding an optional std::locale argument to lexical_cast?
An optional agrument for default value had been recently discussed: http://thread.gmane.org/gmane.comp.lib.boost.devel/184795 It was best summarized by David Abrahams:
lexical_cast is conceptually simple and should remain that way. The proper interface for the functionality you seek should be considered without reference to lexical_cast.
In fact, if we put together all the badly needed functionality that overlaps with lexical_cast, and give it appropriate interfaces, I'm not entirely convinced that there would be much use for lexical_cast anymore.
Kevlin Henney (the author of lexical_cast) is not convinced too: (from off-list conversation)
Yes, agreed. This suggestion has come up before and, although a useful idea, it is slightly beyond the scope of what lexical_cast should be doing.
Over time there have been many little suggestions like this that, had they been accepted, would have led to severe scope drift in lexical_cast, turning it into something that would rival I/O streams and locales for complexity!
I think this is the kind of facility that is better offered by a more dedicated family of conversion functions with richer interfaces.
Regards,
Kevlin
Good news is that Vladimir is developing a richer interface. http://thread.gmane.org/gmane.comp.lib.boost.devel/186191/ You can discuss your idea with him. Thanks, Alex