[concept_check] Restricting to floating point arguments

Hi there,
I need to make sure that a given template class is only instantiated with
integer types, and another one only with the likes of float or double.
I have played with boost::concept_check and was wondering, why it is
possible to say
BOOST_CONCEPT_ASSERT((Integer<T>));
while there is no predefined
BOOST_CONCEPT_ASSERT((FloatingPoint<T>));
The simple code below seems to do its job, so there must be some trade-off
which I do not see ?
/*************************************************************************/
#include <iostream>
#include

I need to make sure that a given template class is only instantiated with integer types, and another one only with the likes of float or double.
I have played with boost::concept_check and was wondering, why it is possible to say
You could also use the type_traits is_integral and is_floating_point in conjunction with either enable_if or a static assert. HTH, John.
participants (2)
-
John Maddock
-
Ruediger Berlich