diff --git a/include/boost/optional/detail/optional_reference_spec.hpp b/include/boost/optional/detail/optional_reference_spec.hpp index 5a76a68..35319cc 100644 --- a/include/boost/optional/detail/optional_reference_spec.hpp +++ b/include/boost/optional/detail/optional_reference_spec.hpp @@ -28,29 +28,29 @@ void prevent_binding_rvalue() } template -typename boost::remove_reference::type& forward_reference(T&& r) +BOOST_DEDUCED_TYPENAME boost::remove_reference::type& forward_reference(T&& r) { BOOST_STATIC_ASSERT_MSG(boost::is_lvalue_reference::value, "binding rvalue references to optional lvalue references is disallowed"); return boost::forward(r); } -template +template struct is_optional_ { static const bool value = false; }; -template -struct is_optional_<::boost::optional> +template +struct is_optional_< ::boost::optional > { static const bool value = true; }; -template +template struct is_no_optional { - static const bool value = !is_optional_::type>::value; + static const bool value = !is_optional_::type>::value; }; } // namespace detail @@ -90,7 +90,7 @@ public: T& value() const { return ptr_ ? *ptr_ : (throw_exception(bad_optional_access()), *ptr_); } - template + template T& value_or_eval(F f) const { return ptr_ ? *ptr_ : detail::forward_reference(f()); } bool operator!() const BOOST_NOEXCEPT { return ptr_ == 0; }