What is the difference between nullptr and nullptr_t in C++?

Moiz Sajid picture Moiz Sajid · Jun 24, 2015 · Viewed 7.6k times · Source

Which one should I use? Any advantages if I use one over the other?

Answer

Quentin picture Quentin · Jun 24, 2015

nullptr is the constant, nullptr_t is its type. Use each one in contexts where you need respectively a null pointer, or the type of a null pointer.