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

boost::none gets a separate instance in each translation unit #33

Closed
akrzemi1 opened this issue Jun 5, 2017 · 2 comments
Closed

boost::none gets a separate instance in each translation unit #33

akrzemi1 opened this issue Jun 5, 2017 · 2 comments

Comments

@akrzemi1
Copy link
Member

akrzemi1 commented Jun 5, 2017

No description provided.

@akrzemi1
Copy link
Member Author

akrzemi1 commented Jun 5, 2017

Provide a (still header-only) implementation that only renders a single instance of boost::none, e.g. using an enum.

@Lastique
Copy link
Member

Lastique commented Oct 2, 2019

As commented in boostorg/core#63 (comment), unscoped enums can implicitly convert to int, which can cause trouble with function overloads.

You may want to consider marking none with inline on C++17 compilers (conditioned on BOOST_NO_CXX17_INLINE_VARIABLES).

Lastique added a commit to Lastique/optional that referenced this issue Oct 29, 2019
This should avoid duplicating none instances in all translation units.

Closes boostorg#33.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants