Boost logo

Boost Users :

Subject: Re: [Boost-users] [concept_check] Restricting to floating pointarguments
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-07-02 11:57:14

> 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.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at