We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The stdlib provides forwarding ref. overloads and variadic template overloads for make_optional: http://en.cppreference.com/w/cpp/utility/optional/make_optional
make_optional
The same is missing from boost::optional at least from what I can tell (correct me if I'm wrong).
boost::optional
All I could find here are these two overloads:
optional<T> make_optional ( T const& v ) optional<T> make_optional ( bool cond, T const& v )
Which is sub-optimal since now users expecting a move will end up doing a copy instead:
boost::make_optional(std::move(bigObject)); // oops, calls T const& overload making a copy
cc @K-ballo
The text was updated successfully, but these errors were encountered:
Indeed. The rvalue overloads are missing.
Sorry, something went wrong.
d2f8a42
Merge pull request #31 from daniel-j-h/forwarding-make-optional
6cd5135
Adds forwarding make_optional helpers, resolves #30
c695be1
No branches or pull requests
The stdlib provides forwarding ref. overloads and variadic template overloads for
make_optional
:http://en.cppreference.com/w/cpp/utility/optional/make_optional
The same is missing from
boost::optional
at least from what I can tell (correct me if I'm wrong).All I could find here are these two overloads:
Which is sub-optimal since now users expecting a move will end up doing a copy instead:
cc @K-ballo
The text was updated successfully, but these errors were encountered: