
Sorry, I ment enable_if< is_decimal_type<T> >::type. The ::type will be expanded to either void or a derivable type. Ovanes. -----Original Message----- From: Ovanes Markarian [mailto:om_boost@keywallet.com] Sent: Mittwoch, 7. März 2007 17:43 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [enable_if] using enable_if toextendstd::numeric_limits? Hi! I think you need to derive your class from enable_if< is_decimal_type<T> >. If your compiler supports SFINAE and is_decimal_type<T>::value is false_ template will be derived from void which is not legal... Best Regards, Ovanes -----Original Message----- From: james.jones@firstinvestors.com [mailto:james.jones@firstinvestors.com] Sent: Mittwoch, 7. März 2007 17:21 To: boost-users@lists.boost.org Subject: [Boost-users] [enable_if] using enable_if to extendstd::numeric_limits? Suppose I have a set of templates that have a common interface (each is a model of the same concept, to use that lingo). I'd like to extend std::numeric_limits to support this concept. I'm trying to find a way to use enable_if to do this, but I don't see how. Is this possible? Is there some other trick to doing this? Example with code (not real code): template< class U, class V > class model1; tempalte< class U, class V > class model2; template< class U > is_decimal_type { static const bool value = false; }; template< class U, class V > is_decimal_type < model1 > { static const bool value = true; }; template< class U, class V > is_decimal_type < model2 > { static const bool value = true; }; Would like to do this: template< class T > class numeric_limits< T > { // extensions go here }; But only if is_decimal_type<T>::value is true (so that the partial specialization only applies to my concept). Thanks, - James Jones Administrative Data Mgmt. Webmaster 375 Raritan Center Pkwy, Suite A Data Architect Edison, NJ 08837 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users