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:
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