691template <
class LHS_TYPE,
class RHS_TYPE>
694#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
696 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
700template <
class LHS_TYPE,
class RHS_TYPE>
703#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
705 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
709template <
class LHS_TYPE,
class RHS_TYPE>
712#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
714 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
718#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
719template <
class LHS_TYPE,
class RHS_TYPE>
720bool operator==(
const NullableValue<LHS_TYPE>& lhs,
721 const std::optional<RHS_TYPE>& rhs)
722#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
724 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
728template <
class LHS_TYPE,
class RHS_TYPE>
729bool operator==(
const std::optional<LHS_TYPE>& lhs,
730 const NullableValue<RHS_TYPE>& rhs)
731#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
733 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
745template <
class LHS_TYPE,
class RHS_TYPE>
748#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
750 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
754template <
class LHS_TYPE,
class RHS_TYPE>
757#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
759 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
763template <
class LHS_TYPE,
class RHS_TYPE>
766#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
768 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
772#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
773template <
class LHS_TYPE,
class RHS_TYPE>
774bool operator!=(
const std::optional<LHS_TYPE>& lhs,
775 const NullableValue<RHS_TYPE>& rhs)
776#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
778 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
782template <
class LHS_TYPE,
class RHS_TYPE>
783bool operator!=(
const NullableValue<LHS_TYPE>& lhs,
784 const std::optional<RHS_TYPE>& rhs)
785#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
787 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
799template <
class LHS_TYPE,
class RHS_TYPE>
802#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
803 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
804 requires { { *lhs != rhs } -> NullableValue_ConvertibleToBool; }
807template <
class LHS_TYPE,
class RHS_TYPE>
808bool operator!=(
const LHS_TYPE& lhs,
810#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
811 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
812 requires { { lhs != *rhs } -> NullableValue_ConvertibleToBool; }
822template <
class LHS_TYPE,
class RHS_TYPE>
825#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
826 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
827 requires { { *lhs == rhs } -> NullableValue_ConvertibleToBool; }
830template <
class LHS_TYPE,
class RHS_TYPE>
831bool operator==(
const LHS_TYPE& lhs,
833#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
834 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
835 requires { { lhs == *rhs } -> NullableValue_ConvertibleToBool; }
846template <
class LHS_TYPE,
class RHS_TYPE>
849#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
851 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
855template <
class LHS_TYPE,
class RHS_TYPE>
858#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
860 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
864template <
class LHS_TYPE,
class RHS_TYPE>
867#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
869 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
873#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
874template <
class LHS_TYPE,
class RHS_TYPE>
875bool operator<(
const std::optional<LHS_TYPE>& lhs,
876 const NullableValue<RHS_TYPE>& rhs)
877#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
879 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
883template <
class LHS_TYPE,
class RHS_TYPE>
884bool operator<(
const NullableValue<LHS_TYPE>& lhs,
885 const std::optional<RHS_TYPE>& rhs)
886#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
888 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
897template <
class LHS_TYPE,
class RHS_TYPE>
900#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
901 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
902 requires { { *lhs < rhs } -> NullableValue_ConvertibleToBool; }
909template <
class LHS_TYPE,
class RHS_TYPE>
910bool operator<(
const LHS_TYPE& lhs,
912#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
913 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
914 requires { { lhs < *rhs } -> NullableValue_ConvertibleToBool; }
925template <
class LHS_TYPE,
class RHS_TYPE>
928#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
930 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
934template <
class LHS_TYPE,
class RHS_TYPE>
937#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
939 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
943template <
class LHS_TYPE,
class RHS_TYPE>
946#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
948 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
952#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
953template <
class LHS_TYPE,
class RHS_TYPE>
954bool operator>(
const std::optional<LHS_TYPE>& lhs,
955 const NullableValue<RHS_TYPE>& rhs)
956#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
958 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
962template <
class LHS_TYPE,
class RHS_TYPE>
963bool operator>(
const NullableValue<LHS_TYPE>& lhs,
964 const std::optional<RHS_TYPE>& rhs)
965#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
967 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
976template <
class LHS_TYPE,
class RHS_TYPE>
979#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
980 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
981 requires { { *lhs > rhs } -> NullableValue_ConvertibleToBool; }
988template <
class LHS_TYPE,
class RHS_TYPE>
991#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
992 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
993 requires { { lhs > *rhs } -> NullableValue_ConvertibleToBool; }
1003template <
class LHS_TYPE,
class RHS_TYPE>
1006#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1008 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1012template <
class LHS_TYPE,
class RHS_TYPE>
1015#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1017 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1021template <
class LHS_TYPE,
class RHS_TYPE>
1024#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1026 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1030#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1031template <
class LHS_TYPE,
class RHS_TYPE>
1032bool operator<=(
const std::optional<LHS_TYPE>& lhs,
1033 const NullableValue<RHS_TYPE>& rhs)
1034#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1036 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1040template <
class LHS_TYPE,
class RHS_TYPE>
1041bool operator<=(
const NullableValue<LHS_TYPE>& lhs,
1042 const std::optional<RHS_TYPE>& rhs)
1043#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1045 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1054template <
class LHS_TYPE,
class RHS_TYPE>
1056 const RHS_TYPE& rhs)
1057#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1058 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1059 requires { { *lhs <= rhs } -> NullableValue_ConvertibleToBool; }
1066template <
class LHS_TYPE,
class RHS_TYPE>
1069#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1070 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
1071 requires { { lhs <= *rhs } -> NullableValue_ConvertibleToBool; }
1081template <
class LHS_TYPE,
class RHS_TYPE>
1084#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1086 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1090template <
class LHS_TYPE,
class RHS_TYPE>
1093#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1095 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1099template <
class LHS_TYPE,
class RHS_TYPE>
1102#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1104 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1108#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1109template <
class LHS_TYPE,
class RHS_TYPE>
1110bool operator>=(
const std::optional<LHS_TYPE>& lhs,
1111 const NullableValue<RHS_TYPE>& rhs)
1112#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1114 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1118template <
class LHS_TYPE,
class RHS_TYPE>
1119bool operator>=(
const NullableValue<LHS_TYPE>& lhs,
1120 const std::optional<RHS_TYPE>& rhs)
1121#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1123 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1132template <
class LHS_TYPE,
class RHS_TYPE>
1134 const RHS_TYPE& rhs)
1135#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1136 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1137 requires { { *lhs >= rhs } -> NullableValue_ConvertibleToBool; }
1144template <
class LHS_TYPE,
class RHS_TYPE>
1147#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1148 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
1149 requires { { lhs >= *rhs } -> NullableValue_ConvertibleToBool; }
1153#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
1154 defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1159template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
1160constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE> operator<=>(
1161 const NullableValue<LHS_TYPE>& lhs,
1162 const NullableValue<RHS_TYPE>& rhs);
1163template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
1164constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE> operator<=>(
1165 const NullableValue<LHS_TYPE>& lhs,
1167template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
1168constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE> operator<=>(
1169 const NullableValue<LHS_TYPE>& lhs,
1170 const std::optional<RHS_TYPE>& rhs);
1171template <
class LHS_TYPE,
class RHS_TYPE>
1172 requires(!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1173 bsl::three_way_comparable_with<LHS_TYPE, RHS_TYPE>
1174constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
1175 operator<=>(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs);
1179template <
class TYPE>
1180constexpr std::strong_ordering
1181 operator<=>(
const NullableValue<TYPE>& value,
1187template <
class TYPE>
1192#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1195template <
class TYPE>
1202template <
class TYPE>
1206template <
class TYPE>
1211# ifndef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1215template <
class TYPE>
1223template <
class TYPE>
1230template <
class TYPE>
1237template <
class TYPE>
1243template <
class TYPE>
1249template <
class TYPE>
1255template <
class TYPE>
1261template <
class TYPE>
1277template <
class TYPE>
1287template <
class HASHALG,
class TYPE>
1296template <
class TYPE>
1300template <
class TYPE>
1315template <
class TYPE>
1320template <
class TYPE>
1324:
Base(bsl::allocator_arg, allocator)
1327template <
class TYPE>
1330:
Base(static_cast<const
bsl::optional<TYPE>&>(original))
1333template <
class TYPE>
1339 static_cast<const
bsl::optional<TYPE>&>(original))
1342template <
class TYPE>
1348 static_cast<
bsl::optional<TYPE>&>(
MoveUtil::access(original))))
1351template <
class TYPE>
1361template <
class TYPE>
1362template <
class BDE_OTHER_TYPE>
1373template <
class TYPE>
1374template <
class BDE_OTHER_TYPE>
1386template <
class TYPE>
1387template <
class BDE_OTHER_TYPE>
1398template <
class TYPE>
1399template <
class BDE_OTHER_TYPE>
1408:
Base(
bsl::allocator_arg, allocator, value)
1411template <
class TYPE>
1412template <
class BDE_OTHER_TYPE>
1424template <
class TYPE>
1425template <
class BDE_OTHER_TYPE>
1436 MoveUtil::move(static_cast<
bsl::optional<BDE_OTHER_TYPE>&>(
1440template <
class TYPE>
1441template <
class BDE_OTHER_TYPE>
1452template <
class TYPE>
1453template <
class BDE_OTHER_TYPE>
1466template <
class TYPE>
1467template <
class BDE_OTHER_TYPE>
1471:
Base(static_cast<const
bsl::optional<BDE_OTHER_TYPE>&>(original))
1474template <
class TYPE>
1475template <
class BDE_OTHER_TYPE>
1482 static_cast<const
bsl::optional<BDE_OTHER_TYPE>&>(original))
1485template <
class TYPE>
1491template <
class TYPE>
1496:
Base(bsl::allocator_arg, allocator)
1500template <
class TYPE>
1508 if (rhs.has_value()) {
1509 if (this->has_value()) {
1510 this->value() = rhs.
value();
1513 this->emplace(rhs.
value());
1523template <
class TYPE>
1534 if (localRhs.has_value()) {
1535 if (this->has_value()) {
1536 this->value() = MoveUtil::move(localRhs.
value());
1539 this->emplace(MoveUtil::move(localRhs.
value()));
1549template <
class TYPE>
1550template <
class BDE_OTHER_TYPE>
1558 if (rhs.has_value()) {
1559 if (this->has_value()) {
1560 this->value() = rhs.
value();
1563 this->emplace(rhs.
value());
1573template <
class TYPE>
1574template <
class BDE_OTHER_TYPE>
1584 if (rhsLocal.has_value()) {
1585 if (this->has_value()) {
1586 this->value() = MoveUtil::move(rhsLocal.
value());
1589 this->emplace(MoveUtil::move(rhsLocal.
value()));
1599template <
class TYPE>
1600template <
class BDE_OTHER_TYPE>
1612template <
class TYPE>
1613template <
class BDE_OTHER_TYPE>
1621 base = MoveUtil::move(rhs);
1626template <
class TYPE>
1634 if (this->has_value()) {
1635 this->value() = rhs;
1644template <
class TYPE>
1653 if (this->has_value()) {
1654 this->value() = MoveUtil::move(rhs);
1657 this->emplace(MoveUtil::move(rhs));
1663template <
class TYPE>
1664template <
class BDE_OTHER_TYPE>
1672 if (this->has_value()) {
1673 this->value() = rhs;
1682template <
class TYPE>
1692template <
class TYPE>
1693template <
class STREAM>
1700 stream.getInt8(isNull);
1704 bdexStreamIn(stream, this->emplace(), version);
1714template <
class TYPE>
1715template <
class BDE_OTHER_TYPE>
1723template <
class TYPE>
1727 return this->emplace();
1730#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1731template <
class TYPE>
1732template <
class... ARGS>
1740template <
class TYPE>
1744#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1747 return this->dereferenceRaw();
1753template <
class TYPE>
1757 return this->has_value() ? this-> operator->() : address;
1760template <
class TYPE>
1761template <
class STREAM>
1766 const bool isNull = !this->has_value();
1768 stream.putInt8(isNull ? 1 : 0);
1771 bdexStreamOut(stream, this->value(), version);
1777template <
class TYPE>
1781 return !this->has_value();
1784template <
class TYPE>
1794 return maxSupportedBdexVersion(
reinterpret_cast<TYPE *
>(0),
1798#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1799template <
class TYPE>
1809 return maxSupportedBdexVersion(
reinterpret_cast<TYPE *
>(0));
1813template <
class TYPE>
1816 int spacesPerLevel)
const
1818 if (!this->has_value()) {
1826 stream, this->value(), level, spacesPerLevel);
1829template <
class TYPE>
1833#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1836 return this->dereferenceRaw();
1842template <
class TYPE>
1846 return this->value_or(value);
1849template <
class TYPE>
1853 return this->has_value() ? this-> operator->() : value;
1856template <
class TYPE>
1860 return this->has_value() ? this-> operator->() : 0;
1866template <
class LHS_TYPE,
class RHS_TYPE>
1869 const NullableValue<RHS_TYPE>& rhs)
1870#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1872 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
1881template <
class LHS_TYPE,
class RHS_TYPE>
1885#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1887 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
1894template <
class LHS_TYPE,
class RHS_TYPE>
1897 const NullableValue<RHS_TYPE>& rhs)
1898#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1900 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
1907#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1908template <
class LHS_TYPE,
class RHS_TYPE>
1911 const std::optional<RHS_TYPE>& rhs)
1912#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1914 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
1921template <
class LHS_TYPE,
class RHS_TYPE>
1924 const NullableValue<RHS_TYPE>& rhs)
1925#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1927 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
1935template <
class LHS_TYPE,
class RHS_TYPE>
1938 const NullableValue<RHS_TYPE>& rhs)
1939 #ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1941 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
1949template <
class LHS_TYPE,
class RHS_TYPE>
1952 const NullableValue<RHS_TYPE>& rhs)
1953#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1955 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
1962template <
class LHS_TYPE,
class RHS_TYPE>
1966#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1968 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
1975#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1976template <
class LHS_TYPE,
class RHS_TYPE>
1979 const NullableValue<RHS_TYPE>& rhs)
1980#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1982 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
1989template <
class LHS_TYPE,
class RHS_TYPE>
1992 const std::optional<RHS_TYPE>& rhs)
1993#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1995 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
2003template <
class LHS_TYPE,
class RHS_TYPE>
2005bool bdlb::operator==(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2006#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2007 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2008 requires { { *lhs == rhs } -> NullableValue_ConvertibleToBool; }
2014template <
class LHS_TYPE,
class RHS_TYPE>
2016bool bdlb::operator==(
const LHS_TYPE& lhs,
const NullableValue<RHS_TYPE>& rhs)
2017#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2018 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2019 requires { { lhs == *rhs } -> NullableValue_ConvertibleToBool; }
2025template <
class LHS_TYPE,
class RHS_TYPE>
2027bool bdlb::operator!=(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2028#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2029 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2030 requires { { *lhs != rhs } -> NullableValue_ConvertibleToBool; }
2036template <
class LHS_TYPE,
class RHS_TYPE>
2038bool bdlb::operator!=(
const LHS_TYPE& lhs,
const NullableValue<RHS_TYPE>& rhs)
2039#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2040 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2041 requires { { lhs != *rhs } -> NullableValue_ConvertibleToBool; }
2047template <
class LHS_TYPE,
class RHS_TYPE>
2050 const NullableValue<RHS_TYPE>& rhs)
2051#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2053 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
2061template <
class LHS_TYPE,
class RHS_TYPE>
2064 const NullableValue<RHS_TYPE>& rhs)
2065#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2067 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
2071 return lhs < static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
2074template <
class LHS_TYPE,
class RHS_TYPE>
2078#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2080 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
2087#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2088template <
class LHS_TYPE,
class RHS_TYPE>
2091 const NullableValue<RHS_TYPE>& rhs)
2092#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2094 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
2098 return lhs < static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
2101template <
class LHS_TYPE,
class RHS_TYPE>
2104 const std::optional<RHS_TYPE>& rhs)
2105#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2107 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
2115template <
class LHS_TYPE,
class RHS_TYPE>
2117bool bdlb::operator<(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2118#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2119 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2120 requires { { *lhs < rhs } -> NullableValue_ConvertibleToBool; }
2126template <
class LHS_TYPE,
class RHS_TYPE>
2128bool bdlb::operator<(
const LHS_TYPE& lhs,
const NullableValue<RHS_TYPE>& rhs)
2129#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2130 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2131 requires { { lhs < *rhs } -> NullableValue_ConvertibleToBool; }
2134 return lhs < static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
2137template <
class LHS_TYPE,
class RHS_TYPE>
2140 const NullableValue<RHS_TYPE>& rhs)
2141#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2143 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
2151template <
class LHS_TYPE,
class RHS_TYPE>
2154 const NullableValue<RHS_TYPE>& rhs)
2155#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2157 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
2164template <
class LHS_TYPE,
class RHS_TYPE>
2168#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2170 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
2177#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2178template <
class LHS_TYPE,
class RHS_TYPE>
2181 const NullableValue<RHS_TYPE>& rhs)
2182#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2184 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
2191template <
class LHS_TYPE,
class RHS_TYPE>
2194 const std::optional<RHS_TYPE>& rhs)
2195#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2197 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
2205template <
class LHS_TYPE,
class RHS_TYPE>
2208 const RHS_TYPE& rhs)
2209#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2210 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2211 requires { { *lhs > rhs } -> NullableValue_ConvertibleToBool; }
2217template <
class LHS_TYPE,
class RHS_TYPE>
2220 const NullableValue<RHS_TYPE>& rhs)
2221#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2222 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2223 requires { { lhs > *rhs } -> NullableValue_ConvertibleToBool; }
2229template <
class LHS_TYPE,
class RHS_TYPE>
2232 const NullableValue<RHS_TYPE>& rhs)
2233#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2235 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
2243template <
class LHS_TYPE,
class RHS_TYPE>
2246 const NullableValue<RHS_TYPE>& rhs)
2247#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2249 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
2253 return lhs <= static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
2256template <
class LHS_TYPE,
class RHS_TYPE>
2260#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2262 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
2269#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2270template <
class LHS_TYPE,
class RHS_TYPE>
2273 const NullableValue<RHS_TYPE>& rhs)
2274#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2276 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
2280 return lhs <= static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
2283template <
class LHS_TYPE,
class RHS_TYPE>
2286 const std::optional<RHS_TYPE>& rhs)
2287#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2289 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
2297template <
class LHS_TYPE,
class RHS_TYPE>
2300 const RHS_TYPE& rhs)
2301#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2302 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2303 requires { { *lhs <= rhs } -> NullableValue_ConvertibleToBool; }
2309template <
class LHS_TYPE,
class RHS_TYPE>
2312 const NullableValue<RHS_TYPE>& rhs)
2313#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2314 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2315 requires { { lhs <= *rhs } -> NullableValue_ConvertibleToBool; }
2318 return lhs <= static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
2322template <
class LHS_TYPE,
class RHS_TYPE>
2325 const NullableValue<RHS_TYPE>& rhs)
2326#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2328 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
2336template <
class LHS_TYPE,
class RHS_TYPE>
2339 const NullableValue<RHS_TYPE>& rhs)
2340#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2342 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
2349template <
class LHS_TYPE,
class RHS_TYPE>
2353#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2355 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
2362#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2363template <
class LHS_TYPE,
class RHS_TYPE>
2366 const NullableValue<RHS_TYPE>& rhs)
2367#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2369 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
2376template <
class LHS_TYPE,
class RHS_TYPE>
2379 const std::optional<RHS_TYPE>& rhs)
2380#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2382 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
2390template <
class LHS_TYPE,
class RHS_TYPE>
2393 const RHS_TYPE& rhs)
2394#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2395 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2396 requires { { *lhs >= rhs } -> NullableValue_ConvertibleToBool; }
2402template <
class LHS_TYPE,
class RHS_TYPE>
2405 const NullableValue<RHS_TYPE>& rhs)
2406#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2407 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2408 requires { { lhs >= *rhs } -> NullableValue_ConvertibleToBool; }
2415#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
2416 defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2418template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
2419constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2420bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
2421 const NullableValue<RHS_TYPE>& rhs)
2427template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
2428constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2429bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
2435template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
2436constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2437bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
2438 const std::optional<RHS_TYPE>& rhs)
2443template <
class LHS_TYPE,
class RHS_TYPE>
2444 requires(!bdlb::NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2445 bsl::three_way_comparable_with<LHS_TYPE, RHS_TYPE>
2446constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2447bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2452template <
class TYPE>
2453constexpr std::strong_ordering
2454bdlb::operator<=>(
const NullableValue<TYPE>& value,
2457 return (!value.isNull()) <=>
false;
2462template <
class TYPE>
2467 return !value.has_value();
2470#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2472template <
class TYPE>
2477 return !value.has_value();
2480template <
class TYPE>
2485 return value.has_value();
2488template <
class TYPE>
2493 return value.has_value();
2496# ifndef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2498template <
class TYPE>
2506template <
class TYPE>
2511 return value.has_value();
2514template <
class TYPE>
2519 return value.has_value();
2522template <
class TYPE>
2530template <
class TYPE>
2535 return !value.has_value();
2538template <
class TYPE>
2546template <
class TYPE>
2554template <
class TYPE>
2559 return !value.has_value();
2565template <
class TYPE>
2568 const NullableValue<TYPE>&
object)
2570 return object.print(stream, 0, -1);
2574template <
class HASHALG,
class TYPE>
2577 if (!input.isNull()) {
2586template <
class TYPE>
2590bdlb::swap(NullableValue<TYPE>& lhs, NullableValue<TYPE>& rhs)
2596template <
class TYPE>
2600bdlb::swap(NullableValue<TYPE>& lhs, NullableValue<TYPE>& rhs)
2607#ifdef BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_GNU_WORKAROUND_NEEDED
2612template <
typename _Tp>
2613inline constexpr bool __is_optional_v<BloombergLP::bdlb::NullableValue<_Tp>> =
2618#ifdef BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_MSVC_WORKAROUND_NEEDED
2623template <
typename _Tp>
2625constexpr bool _Is_specialization_v<BloombergLP::bdlb::NullableValue<_Tp>,
2626 std::optional> =
true;