isPolymorphicType_selector< is_class > Struct Template Reference

isPolymorphicType_selector exists to work around a compile error problem: More...

#include <classTraits.h>


struct  rebind

Detailed Description

template<bool is_class>
struct cxxtls::isPolymorphicType_selector< is_class >

isPolymorphicType_selector exists to work around a compile error problem:

If you use a type, it must be syntactically correct -- unless it is a template which does not always have to.

The error occurred when we tried to use the isPolymorphicType_impl<enumType>. Since there are an infinite number of enum types, we can't specially them all. The work around is to check for a class object before attempting to instantiating isPolymorphicType_impl<T>. In this way, if the data type isn't a class, we never instantiate the offending type.

To pull this off, a choice of isPolymorphicType_selector<T> is made. One specialization, for classes, has a nested sub-type template defines a sub-sub-type which invokes isPolymorphicType_impl<T>. The other specialization of isPolymorphicType_selector does not invoke isPolymorphicType_impl<T>, but just stops with a false indication.

The rebind<T> syntax is just a compilicated way of not compiling isPolymorphicType_impl<T> -- unless we absolutely need it.

Definition at line 753 of file classTraits.h.

The documentation for this struct was generated from the following file:
Generated on Wed Feb 29 22:55:57 2012 for CXXUtilities by  doxygen 1.6.3