19 Jan
2005
19 Jan
'05
6:56 a.m.
1. lexical_cast(Source arg) takes the source argument by value. Why not by const& ? Calling lexical_cast(some_basic_string) now makes a copy of the source argument for no reason.
There actually was a reason. Something about certain functions not working properly with a const&. Like the std::limits or something like that. (I ran into this problem because lexical_cast(Parent p) when given a child will actually create a parent object, so no amount of overriding virtuals changes things.)
The thing about the parent being created is serious. So the problem is even more severe than I thought...