
6 Dec
2009
6 Dec
'09
6:05 p.m.
----- Original Message ----- From: "joel falcou" <joel.falcou@lri.fr> To: <boost@lists.boost.org> Sent: Sunday, December 06, 2009 10:57 AM Subject: Re: [boost] [chrono] type_traits/common_type and integer/ratio
joel falcou wrote:
could be nice if they used mpl::integral_c so it can be used easily as MPL meta-functions forgot the code obv. :
namespace mpl { template<class X> struct abs : integral_c< typename X::value_type, (X < 0 ? -X : X)> {}; }
etc
--
Hi Joel, even if template <boost::intmax_t X> struct static_abs { static const boost::intmax_t value = X < 0 ? -X : X; }; don't use mpl::integral_c, it is a valid mpl metafunction. I don't think it is worth adding a dependency to Boost.MPL. Best, Vicente