MCPcopy Create free account
hub / github.com/p-ranav/tabulate / value)

Method value)

include/tabulate/optional_lite.hpp:1006–1019  ·  view source on GitHub ↗

NOLINTNEXTLINE( cppcoreguidelines-c-copy-assignment-signature, misc-unconventional-assign-operator )

Source from the content-addressed store, hash-verified

1004 // NOLINTNEXTLINE( cppcoreguidelines-c-copy-assignment-signature,
1005 // misc-unconventional-assign-operator )
1006 optional_REQUIRES_R(
1007 optional &,
1008 std::is_constructible<T, U>::value &&std::is_assignable<T &, U>::value &&
1009 !std::is_same<typename std20::remove_cvref<U>::type, nonstd_lite_in_place_t(U)>::value &&
1010 !std::is_same<typename std20::remove_cvref<U>::type, optional<T>>::value &&
1011 !(std::is_scalar<T>::value && std::is_same<T, typename std::decay<U>::type>::value))
1012 operator=(U &&value) {
1013 if (has_value()) {
1014 contained.value() = std::forward<U>(value);
1015 } else {
1016 initialize(T(std::forward<U>(value)));
1017 }
1018 return *this;
1019 }
1020
1021#else // optional_CPP11_OR_GREATER
1022

Callers

nothing calls this directly

Calls 1

initializeFunction · 0.70

Tested by

no test coverage detected