4 ms·
Having so much syntax makes the language more difficult to learn, and you have to know the edge cases of each. It's universally recognized that, since C++11, y
by favorited 7y ago
Having so much syntax makes the language more difficult to learn, and you have to know the edge cases of each.
It's universally recognized that, since C++11, you should use the `nullptr` keyword to create a null pointer. `nullptr` solves problems like not being implicitly convertible to integers, so you don't get the wrong overloads or template specializations.
However, it's still perfectly valid to initialize a pointer to the NULL macro, etc. There's no benefit, but it's still all throughout codebases, so people will keep using it. Wouldn't it be nice if there was just one way to initialize a null pointer in new code?