Boost logo

Boost Users :

Subject: Re: [Boost-users] [TypeTraits] is_arithmetic and is_enum together?
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-09-23 11:54:15


> Is there a type trait that defines both is_arithmetic and is_enum
> together?
> (not is_scalar though)
>
> I find I'm doing this often:
>
> BOOST_STATIC_ASSERT(boost::is_arithmetic<Integer>::value == true ||
> boost::is_enum<Integer>::value == true);
>
> which lead me to wondering if there was a more granular trait which
> included
> the two

Nope. But you could easily write your own - it's not the intention of type
traits to provide every possible combination ;-)

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net