[C++-sig] Must be CopyConstructible for stringification?
ak at ixion.net
Wed Feb 25 12:33:14 CET 2004
I've discovered that in order to have a __str__ method, i.e. to be able to
on a class_, it has to be CopyConstructible, or rather, is copy
constructed when passed to boost::lexical_cast. This strikes me as
slightly odd, since a reference would have done just as well, and not
everything that can be sensibly stringified is also copyconstructible
(or cheaply so, thinking matrices and lists).
In short: Wouldn't it make sense to pass lexical_cast a reference
instead of a copy?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the Cplusplus-sig