
2 Nov
2009
2 Nov
'09
8:26 p.m.
Am Monday 02 November 2009 19:51:34 schrieb Gottlob Frege:
On Sun, Nov 1, 2009 at 4:16 PM, Bruno Lalande <bruno.lalande@gmail.com> wrote:
Example:
template <class T> T my_robustness_sensitive_function(T value) { value /= 2; T value2 = boost::to<T>("123.0123456789"); return value; };
Not sure about the to<> - it is a bit small/ambiguous to not have a namespace.
what's wrong with lexical_cast? it would put the requirement of operator<< on the number type T, but I don't see how that is worse than specializing a new boost::to template for each number type. a number type T most likely supports streaming anyway, and lexical_cast is implemented by streaming from a std::stringstream