19 class value_or_reference
22 template <
typename U = T,
typename boost::enable_if<std::is_constructible<T, U&&>>::type* =
nullptr>
23 value_or_reference(U&& value = {})
24 : _value{ std::forward<U>(value) },
28 value_or_reference(std::reference_wrapper<T> ref) BOND_NOEXCEPT
33 value_or_reference(boost::reference_wrapper<T> ref) BOND_NOEXCEPT
38 value_or_reference(
const value_or_reference& other)
39 : _value{ other._value },
40 _ref{ _value ? std::ref(*_value) : other._ref }
43 value_or_reference& operator=(
const value_or_reference& other)
45 _value = other._value;
46 _ref = _value ? std::ref(*_value) : other._ref;
50 T& get()
const BOND_NOEXCEPT
57 friend class value_or_reference;
59 boost::optional<T> _value;
60 std::reference_wrapper<T> _ref;