move constructor for pointer type?

c++, c++11

Solution

is a guaranteed to point to NULL ?

No, it will be unchanged. Initialisation of built-in types will never modify the initialiser. Only initialisation of a class type with a move constructor (or an evil non-constant copy constructor, such as `auto_ptr`) could modify it.

For example, if you used `std::unique_ptr` rather than dumb pointers, then `a` would be empty after the initialisation of `b`.

How about if `a` and `b` were ints?

Still no.

Problem

This is a simple question but I can't manage to find it on google: Is there a special move constructor for integral type(including pointers) For instance if I do: ``` int* a = new int(2); int* b = std::move(a); ``` Is it guaranteed to point to NULL? How about if a and b were `int`?

Original source