Skip to content

Use keyword nullptr where possible#247

Merged
etr merged 1 commit intoetr:masterfrom
LeSpocky:nullptr
Nov 23, 2021
Merged

Use keyword nullptr where possible#247
etr merged 1 commit intoetr:masterfrom
LeSpocky:nullptr

Conversation

@LeSpocky
Copy link
Contributor

Identify the Bug

#241

Description of the Change

Replace every usage of 0x0 or NULL with nullptr, which is available since C++11.

NULL, or 0x0, or nullptr, or even 0 was used over the entiry code base before for expressing the concept of a null pointer. Use the C++ special word nullptr instead to unify the code base and minimize friction with expectations of modern C++ developers.

Alternate Designs

Using NULL instead would have been possible to unify the code base and show developer a null pointer is meant, but that's not C++ and it lacks the advantages of the nullptr keyword.

Possible Drawbacks

Maybe such style changes are not desired? No functional drawbacks.

Verification Process

Ran cpplint and unit tests.

Release Notes

N/A

Replace every usage of 0x0 or NULL with nullptr, which is available
since C++11.  NULL, or 0x0, or nullptr, or even 0 was used over the
entiry code base before for expressing the concept of a null pointer.
Use the C++ special word nullptr instead to unify the code base and
minimize friction with expectations of modern C++ developers.

References: etr#241
Signed-off-by: Alexander Dahl <post@lespocky.de>
@etr
Copy link
Owner

etr commented Nov 23, 2021

Thanks for the great piece of cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants