is_class template in C++ Last Updated : 19 Nov, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The std::is_class template of C++ STL is used to check whether the given type is class or not. It returns a boolean value showing the same. Syntax: template <class T> struct is_class; Parameter: This template accepts single parameter T (Trait class) to check whether T is a class or not. Return Value: This template returns a boolean value as shown below: True: If a type is a class class. False: If a type is a class class. Below programs illustrate the std::is_class template in C++: Program 1:: CPP // C++ program to illustrate // is_class template #include <iostream> #include <type_traits> using namespace std; class GFG1 { }; union GFG2 { int var1; float var2; }; int main() { cout << boolalpha; cout << "is_class:" << endl; cout << "GFG1: " << is_class<GFG1>::value << endl; cout << "GFG2: " << is_class<GFG2>::value << endl; return 0; } Output: is_class: GFG1: true GFG2: false Program 2: CPP // C++ program to illustrate // is_class template #include <iostream> #include <type_traits> using namespace std; class GFG1 { int var1; float var2; char var3; }; struct GFG2 { union { int var4; float var5; }; }; int main() { cout << boolalpha; cout << "is_class:" << endl; cout << "int: " << is_class<int>::value << endl; cout << "GFG1: " << is_class<GFG1>::value << endl; cout << "GFG2: " << is_class<GFG2>::value << endl; return 0; } Output: is_class: int: false GFG1: true GFG2: true Comment More infoAdvertise with us Next Article is_empty template in C++ R rajasethupathi Follow Improve Article Tags : Misc C++ CPP-Library Practice Tags : CPPMisc Similar Reads is_const Template in C++ The std::is_const template of C++ STL is used to check whether the type is a const-qualified or not. It returns a boolean value showing the same. Syntax: template < class T >struct is_const; Template Parameter: This template contains single parameter T (Trait class) to check whether T is a con 2 min read is_abstract template in C++ The std::is_abstract template of C++ STL is used to check whether the type is a abstract class type or not. It returns a boolean value showing the same. Syntax: template < class T > struct is_abstract; Parameter: This template contains single parameter T (Trait class) to check whether T is a a 2 min read is_empty template in C++ The std::is_empty template of C++ STL is used to check whether the given type is empty or not. This method returns a boolean value showing whether the given type is empty or not. Syntax: template < class T > struct is_empty; Parameters: This template contains single parameter T (Trait class) t 2 min read is_pod template in C++ The std::is_pod template of C++ STL is used to check whether the type is a plain-old data(POD) type or not. It returns a boolean value showing the same. Syntax: template < class T > struct is_pod; Parameter: This template contains single parameter T (Trait class) to check whether T is a pod ty 2 min read is_void template in C++ The std::is_void template of C++ STL is used to check whether the type is a void or not. It returns a boolean value showing the same. Syntax: template < class T > struct is_void; Parameter: This template contains single parameter T (Trait class) to check whether T is a void type or not. Return 2 min read is_arithmetic Template in C++ The std::is_arithmetic templateof C++ STL is used to check whether the given type is arithmetic or not. An Arithmetic type means an integral type or a floating-point type. It returns a boolean value showing the same. Syntax: template <class T> struct is_arithmetic; Parameters: This template ac 3 min read Like