Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does ETL need a nullptr_t type? #922

Closed
tigran2008 opened this issue Jul 16, 2024 · 0 comments
Closed

Does ETL need a nullptr_t type? #922

tigran2008 opened this issue Jul 16, 2024 · 0 comments
Assignees

Comments

@tigran2008
Copy link
Contributor

tigran2008 commented Jul 16, 2024

Seeing issue #921, I noticed that ETL doesn't have a nullptr_t. Are you for or against having an etl::nullptr_t type, and if you wouldn't mind having it, what do you think of implementing <etl/nullptr.h> like this instead?

namespace etl
{
#if ETL_CPP11_NOT_SUPPORTED
  // Use the old style C++ NULL definition.
  typedef enum { _nullptr = 0 } nullptr_t;
  #define ETL_NULLPTR (etl::_nullptr)
#else
  // Use the new style nullptr.
  typedef decltype(nullptr) nullptr_t;
  #define ETL_NULLPTR nullptr
#endif
} // namespace etl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants