MCPcopy Create free account
hub / github.com/ThePhD/sol2 / value_or

Function value_or

include/sol/optional_implementation.hpp:1422–1425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420 /// \group value_or
1421 template <class U>
1422 constexpr T value_or(U&& u) const& {
1423 static_assert(std::is_copy_constructible<T>::value && std::is_convertible<U&&, T>::value, "T must be copy constructible and convertible from U");
1424 return has_value() ? **this : static_cast<T>(std::forward<U>(u));
1425 }
1426
1427 /// \group value_or
1428 template <class U>

Callers

nothing calls this directly

Calls 1

has_valueFunction · 0.85

Tested by

no test coverage detected