
3 May
2011
3 May
'11
9:51 p.m.
Christopher Jefferson <chris <at> bubblescope.net> writes: ... Out of interest, what would:
auto str = boost::convert<std::string>::from(123);
Do? If boost::convert stores by pointer/reference, it would be quite dangerous.
I think making libraries 'auto safe' is a good idea, I expect to see auto usage shoot up very quickly, and libraries should do their best to work well with auto.
boost::convert<std::string>::from(123) return a converter object. Some might consider that design decision wacky/bad/etc. but it there for a reason to satisfy other use-cases. For 'auto' to work one will need to explicitly call value() as follows: auto str = boost::convert<std::string>::from(123).value(); V.