
6 Dec
2004
6 Dec
'04
2:48 p.m.
"Agoston Bejo" <gusz1@freemail.hu> escribió en el mensaje news:cp071h$fog$2@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