#include <Misc.H>
Use the SFINAE principle as described in 15.2.2 "Determining Class Types" in Vandevoorde and Josuttis "C++ Templates" book to see if T is class type. E.g., TypeTr<int>::IsClass == false TypeTr<Box>::IsClass == true
Public Types | |
| enum | { IsClass = sizeof(TypeTr<T>::template test<T>(0)) == 1 } |
| enum | { IsClass = sizeof(TypeTr<T>::template test<T>(0)) == 1 } |
Private Types | |
| typedef char | One |
| typedef char | One |
Static Private Member Functions | |
| template<typename C> | |
| static One | test (int C::*) |
| template<typename C> | |
| static Two | test (...) |
| template<typename C> | |
| static One | test (int C::*) |
| template<typename C> | |
| static Two | test (...) |
Classes | |
| struct | Two |
typedef char Misc::TypeTr< T >::One [private] |
typedef char Misc::TypeTr< T >::One [private] |
| static One Misc::TypeTr< T >::test | ( | int C::* | ) | [inline, static, private] |
| static Two Misc::TypeTr< T >::test | ( | ... | ) | [inline, static, private] |
| static One Misc::TypeTr< T >::test | ( | int C::* | ) | [inline, static, private] |
| static Two Misc::TypeTr< T >::test | ( | ... | ) | [inline, static, private] |
1.5.5