VOOZH about

URL: https://www.geeksforgeeks.org/cpp/std-is_object-template-in-c/

⇱ std is_object Template in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

std is_object Template in C++

Last Updated : 19 Nov, 2018
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::
Output:
is_object:
float: true
float&: false
raj: true
raj&: false
char: true
char&: false
Comment
Article Tags: