c++ - Create is_primitive or is_inheritable template -
I would like to create a template that checks whether a class type is primitive or not (int, four, float, float ** *, Ect ...). The reason for this is preventing another template from attempting to increase the preference and causing a compile time error. So far, I have something on the lines of this:
#include & lt; Typeinfo & gt; Template & lt; Typename T & gt; Straight is_primitive {const constitutes constant values = std :: is_fundamental & lt; T & gt; :: value; }; Obviously this is the right result from the I_fundamental right now I would like to add add_pointer, remove_reference, ect ... so that all those additional modifiers can touch as input classes. What are all the evictions required to make as rude as possible?
Alternatively, the solutions like the following will be equally excellent:
template & lt; Typename T & gt; Struct is_inheritable {const static value = value; }; But I am pretty sure that the set of ineffective classes is equal to the set of primitive sections.
I feel like you want std :: is_class & lt; T & gt; Any class can be obtained only by types, it is a diagram showing the C ++ 11 type classification symptom:
Comments
Post a Comment