Top "Nullptr" questions

The C++11 keyword for a null pointer, it can be converted to any pointer type.

What exactly is nullptr?

We now have C++11 with many new features. An interesting and confusing one (at least for me) is the new …

c++ pointers c++11 nullptr
NULL vs nullptr (Why was it replaced?)

I know that in C++ 0x or NULL was replaced by nullptr in pointer-based applications. I'm just curious of the …

c++ pointers null nullptr
C++11 When clearing shared_ptr, should I use reset or set to nullptr?

I have a question about C++11 best practices. When clearing a shared_ptr, should I use the reset() function with …

c++ c++11 shared-ptr reset nullptr
What are the advantages of using nullptr?

This piece of code conceptually does the same thing for the three pointers (safe pointer initialization): int* p1 = nullptr; int* …

c++ c++11 null c++-faq nullptr
Can I check a C++ iterator against null?

I'm having trouble with vector iterators. I've read in a few places that checking for null iterators isn't possible, and …

c++ pointers vector iterator nullptr
What header file needs to be included for using nullptr in g++?

I am using g++ 4.4.1 and want to use nullptr, but I am not being able to find which header file …

g++ nullptr
Compile error 'nullptr' undeclared identifier

I'm trying to compile a source with Visual Studio 2008 Express, but I'm getting this error: Error C2065: 'nullptr' undeclared identifier. …

c++ visual-studio-2008 nullptr
Can a unique_ptr take a nullptr value?

Is this code fragment valid? : unique_ptr<A> p(new A()); p = nullptr; That is, can I assign …

c++ c++11 pointers unique-ptr nullptr
Using Qt Creator C++ 11, nullptr is keyworded?

I'm using C++11 using Qt Creator. "warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]" "error: 'nullptr' was not …

c++ c++11 qt-creator nullptr
Can nullptr be emulated in gcc?

I saw that nullptr was implemented in Visual Studio 2010. I like the concept and want to start using it as …

c++ gcc c++11 nullptr