Boost type_traits is_array

I'm trying to use Type Boost type headers and feel completely sick, given the intense unreadability provided by countless #define. And a few more #define.

To be specific, I'm interested in figuring out the following three things: if type T is an array, class, or enumeration.

Could someone help suggest some way to decipher the method that underlies the seeming insanity? As a theory underlying how you define a trait from a type, any relevant reading material, etc.

+5
source share
1 answer

is_array pretty simple and straightforward:

template<class T>
struct is_array{
  static const bool value = false;
};

template<class T, std::size_t N>
struct is_array< T (&)[N] >{
  static const bool value = true;
};

reference-to-array.

is_class , ( ). iPod Touch, . , .

is_enum . , .

: , .

+4

All Articles