The type_traits::is_null_pointer of C++ STL is used to check whether the given type is null_pointer or not. It returns the boolean value either true or false. Below is the syntax for the same:
template class T struct is_null_pointer;
Parameter: The template type_traits::is_null_pointer accepts a single parameter T (Trait class) to check whether T is a null_pointer or not.
- True: If the type is a null_pointer.
- False: If the pointer is not null pointer.
Below programs illustrate the std::is_null_pointer template in C++ STL:
is_null_pointer: int *&: true int *: false float *: false int:false
true false false true
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between cout and puts() in C++ with Examples
- Difference between forward list and list in C++
- Short-Circuiting in C++ and Linux
- Different types of range-based for loop iterators in C++
- Learn C++ Programming Step by Step - A 20 Day Curriculum!
- Why do we need reference variables if we have pointers
- Similarities and Difference between Java and C++
- Macros and its types in C/C++
- Reversed Range-based for loop in C++ with Examples
- How to find index of a given element in a Vector in C++
- Introduction to Complex Objects and Composition
- sort() vs. partial_sort() vs. nth_element() + sort() in C++ STL
- Difference between user defined function and library function in C/C++
- NULL undeclared error in C/C++ and how to resolve it
- std::remove_const in C++ with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.