Boost logo

Boost Users :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2004-12-06 09:48:09


"Agoston Bejo" <gusz1_at_[hidden]> escribió en el mensaje
news:cp071h$fog$2_at_sea.gmane.org...
> Hi!
> I may have posted the first half of this question once, sorry for that!
> : )
>
> The question in short: which boost library enables me to get the "wider"
> datatype of two, such that
> get_wider<int, float>::type will be float, and
> get_wider<float, int>::type will also be float.
> Hopefully
> get_wider<int, string>::type will generate a compile-time error, since the
> two are not convertible to each other.
>

#include <boost/numeric/conversion/conversion_traits.hpp>

boost::numeric::conversion_traits<int,float>::supertype

For info about this:

http://www.boost.org/libs/numeric/conversion/doc/conversion_traits.html

HTH

Fernando Cacciola


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net