Re: [Boost-users] [enable_if] using enable_if to extend std::numeric_limits?
From: "Ovanes Markarian"
Ok, I see. This is a bit more complex. ;) Can you influence a type passed to numeric_limits? If yes you can do this:
Thought about that, but it's suboptimal - see my response to me22 for more on this. Basically, I'd like any existing usage of numeric_limits<double> to be able to be replaced by numeric_limits<DecimalType> without any other changes.
It wouldn't be *too* bad to do this:
template< class T, class Enable = void >
decimal_limits {};
template <>
decimal_limits <double> : public std::numeric_limits <double> {};
template <>
decimal_limits <float> : public std::numeric_limits <float> {};
template <class T>
decimal_limits
participants (1)
-
james.jonesīŧ firstinvestors.com