Topic: Numeric_cast (was C++0x)


Author: "Matt Seitz" <mseitz@yahoo.com>
Date: Tue, 8 May 2001 23:00:57 GMT
Raw View
"Niklas Matthies" <news/comp.std.c++@nmhq.net> wrote in message
news:slrn9fg4gh.is.news/comp.std.c++@ns.nmhq.net...
> True, but that's not what is wanted. The original proposal was for
> situations where you *want* convert (say) an unsigned int to an int, but
> want to be notified (by an exception) if *for the particular value* this
> conversion doesn't preserve the value.

I started working on an improved "numeric cast" function, but then I
remembered "boost.org" and decided to check whether I was reinventing the
wheel.  Sure enough, boost.org has a "numeric_cast" template function (see
http://www.boost.org/libs/conversion/cast.htm ).  Would adopting that into
the Standard Library be a good solution to the problem presented in the
original proposal?


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]