The
std::is_object template of C++ STL is used to check whether the given type is object or not. It returns a boolean value showing the same.
Syntax:
template <class T > struct is_object;
Parameter: This template accepts a single parameter
T (Trait class) to check whether T is a object type or not.
Return Value: This template returns a boolean value as shown below:
- True: if the type is a object.
- False: if the type is a non-object.
Below programs illustrate the std::is_object template in C++ STL:
Program 1::
Output:
is_object:
sam: true
sam&: false
int: true
int&: false
Program 2::