731template <
class LHS_TYPE,
class RHS_TYPE>
734#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
736 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
740template <
class LHS_TYPE,
class RHS_TYPE>
743#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
745 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
749template <
class LHS_TYPE,
class RHS_TYPE>
752#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
754 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
758#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
759template <
class LHS_TYPE,
class RHS_TYPE>
760bool operator==(
const NullableValue<LHS_TYPE>& lhs,
761 const std::optional<RHS_TYPE>& rhs)
762#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
764 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
768template <
class LHS_TYPE,
class RHS_TYPE>
769bool operator==(
const std::optional<LHS_TYPE>& lhs,
770 const NullableValue<RHS_TYPE>& rhs)
771#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
773 { *
lhs == *
rhs } -> NullableValue_ConvertibleToBool;
786template <
class LHS_TYPE,
class RHS_TYPE>
789#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
791 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
795template <
class LHS_TYPE,
class RHS_TYPE>
798#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
800 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
804template <
class LHS_TYPE,
class RHS_TYPE>
807#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
809 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
813#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
814template <
class LHS_TYPE,
class RHS_TYPE>
815bool operator!=(
const std::optional<LHS_TYPE>& lhs,
816 const NullableValue<RHS_TYPE>& rhs)
817#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
819 { *lhs != *rhs } -> NullableValue_ConvertibleToBool;
823template <
class LHS_TYPE,
class RHS_TYPE>
824bool operator!=(
const NullableValue<LHS_TYPE>& lhs,
825 const std::optional<RHS_TYPE>& rhs)
826#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
828 { *
lhs != *
rhs } -> NullableValue_ConvertibleToBool;
841template <
class LHS_TYPE,
class RHS_TYPE>
844#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
845 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
846 requires { { *lhs != rhs } -> NullableValue_ConvertibleToBool; }
849template <
class LHS_TYPE,
class RHS_TYPE>
850bool operator!=(
const LHS_TYPE& lhs,
852#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
853 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
854 requires { { lhs != *rhs } -> NullableValue_ConvertibleToBool; }
865template <
class LHS_TYPE,
class RHS_TYPE>
868#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
869 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
870 requires { { *lhs == rhs } -> NullableValue_ConvertibleToBool; }
873template <
class LHS_TYPE,
class RHS_TYPE>
874bool operator==(
const LHS_TYPE& lhs,
876#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
877 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
878 requires { { lhs == *rhs } -> NullableValue_ConvertibleToBool; }
890template <
class LHS_TYPE,
class RHS_TYPE>
893#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
895 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
899template <
class LHS_TYPE,
class RHS_TYPE>
902#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
904 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
908template <
class LHS_TYPE,
class RHS_TYPE>
911#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
913 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
917#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
918template <
class LHS_TYPE,
class RHS_TYPE>
919bool operator<(
const std::optional<LHS_TYPE>& lhs,
920 const NullableValue<RHS_TYPE>& rhs)
921#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
923 { *lhs < *rhs } -> NullableValue_ConvertibleToBool;
927template <
class LHS_TYPE,
class RHS_TYPE>
928bool operator<(
const NullableValue<LHS_TYPE>& lhs,
929 const std::optional<RHS_TYPE>& rhs)
930#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
932 { *
lhs < *
rhs } -> NullableValue_ConvertibleToBool;
941template <
class LHS_TYPE,
class RHS_TYPE>
944#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
945 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
946 requires { { *lhs < rhs } -> NullableValue_ConvertibleToBool; }
953template <
class LHS_TYPE,
class RHS_TYPE>
954bool operator<(
const LHS_TYPE& lhs,
956#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
957 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
958 requires { { lhs < *rhs } -> NullableValue_ConvertibleToBool; }
970template <
class LHS_TYPE,
class RHS_TYPE>
973#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
975 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
979template <
class LHS_TYPE,
class RHS_TYPE>
982#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
984 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
988template <
class LHS_TYPE,
class RHS_TYPE>
991#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
993 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
997#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
998template <
class LHS_TYPE,
class RHS_TYPE>
999bool operator>(
const std::optional<LHS_TYPE>& lhs,
1000 const NullableValue<RHS_TYPE>& rhs)
1001#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1003 { *lhs > *rhs } -> NullableValue_ConvertibleToBool;
1007template <
class LHS_TYPE,
class RHS_TYPE>
1008bool operator>(
const NullableValue<LHS_TYPE>& lhs,
1009 const std::optional<RHS_TYPE>& rhs)
1010#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1012 { *
lhs > *
rhs } -> NullableValue_ConvertibleToBool;
1021template <
class LHS_TYPE,
class RHS_TYPE>
1023 const RHS_TYPE& rhs)
1024#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1025 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1026 requires { { *lhs > rhs } -> NullableValue_ConvertibleToBool; }
1033template <
class LHS_TYPE,
class RHS_TYPE>
1036#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1037 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
1038 requires { { lhs > *rhs } -> NullableValue_ConvertibleToBool; }
1049template <
class LHS_TYPE,
class RHS_TYPE>
1052#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1054 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1058template <
class LHS_TYPE,
class RHS_TYPE>
1061#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1063 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1067template <
class LHS_TYPE,
class RHS_TYPE>
1070#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1072 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1076#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
1077template <
class LHS_TYPE,
class RHS_TYPE>
1078bool operator<=(
const std::optional<LHS_TYPE>& lhs,
1079 const NullableValue<RHS_TYPE>& rhs)
1080#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1082 { *lhs <= *rhs } -> NullableValue_ConvertibleToBool;
1086template <
class LHS_TYPE,
class RHS_TYPE>
1087bool operator<=(
const NullableValue<LHS_TYPE>& lhs,
1088 const std::optional<RHS_TYPE>& rhs)
1089#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1091 { *
lhs <= *
rhs } -> NullableValue_ConvertibleToBool;
1100template <
class LHS_TYPE,
class RHS_TYPE>
1102 const RHS_TYPE& rhs)
1103#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1104 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1105 requires { { *lhs <= rhs } -> NullableValue_ConvertibleToBool; }
1112template <
class LHS_TYPE,
class RHS_TYPE>
1115#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1116 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
1117 requires { { lhs <= *rhs } -> NullableValue_ConvertibleToBool; }
1128template <
class LHS_TYPE,
class RHS_TYPE>
1131#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1133 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1137template <
class LHS_TYPE,
class RHS_TYPE>
1140#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1142 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1146template <
class LHS_TYPE,
class RHS_TYPE>
1149#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1151 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1155#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
1156template <
class LHS_TYPE,
class RHS_TYPE>
1157bool operator>=(
const std::optional<LHS_TYPE>& lhs,
1158 const NullableValue<RHS_TYPE>& rhs)
1159#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1161 { *lhs >= *rhs } -> NullableValue_ConvertibleToBool;
1165template <
class LHS_TYPE,
class RHS_TYPE>
1166bool operator>=(
const NullableValue<LHS_TYPE>& lhs,
1167 const std::optional<RHS_TYPE>& rhs)
1168#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1170 { *
lhs >= *
rhs } -> NullableValue_ConvertibleToBool;
1179template <
class LHS_TYPE,
class RHS_TYPE>
1181 const RHS_TYPE& rhs)
1182#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1183 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1184 requires { { *lhs >= rhs } -> NullableValue_ConvertibleToBool; }
1191template <
class LHS_TYPE,
class RHS_TYPE>
1194#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1195 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
1196 requires { { lhs >= *rhs } -> NullableValue_ConvertibleToBool; }
1200#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
1201 defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1206template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
1207constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE> operator<=>(
1208 const NullableValue<LHS_TYPE>& lhs,
1209 const NullableValue<RHS_TYPE>& rhs);
1210template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
1211constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE> operator<=>(
1212 const NullableValue<LHS_TYPE>& lhs,
1214template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
1215constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE> operator<=>(
1216 const NullableValue<LHS_TYPE>& lhs,
1217 const std::optional<RHS_TYPE>& rhs);
1218template <
class LHS_TYPE,
class RHS_TYPE>
1219 requires(!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
1220 bsl::three_way_comparable_with<LHS_TYPE, RHS_TYPE>
1221constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
1222 operator<=>(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs);
1226template <
class TYPE>
1227constexpr std::strong_ordering
1228 operator<=>(
const NullableValue<TYPE>& value,
1234template <
class TYPE>
1239#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1242template <
class TYPE>
1249template <
class TYPE>
1253template <
class TYPE>
1258# ifndef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1263template <
class TYPE>
1272template <
class TYPE>
1279template <
class TYPE>
1286template <
class TYPE>
1292template <
class TYPE>
1298template <
class TYPE>
1304template <
class TYPE>
1310template <
class TYPE>
1327template <
class TYPE>
1337template <
class HASHALG,
class TYPE>
1346template <
class TYPE>
1350template <
class TYPE>
1365template <
class TYPE>
1370template <
class TYPE>
1374:
Base(bsl::allocator_arg, allocator)
1377template <
class TYPE>
1380:
Base(static_cast<const
bsl::optional<TYPE>&>(original))
1383template <
class TYPE>
1389 static_cast<const
bsl::optional<TYPE>&>(original))
1392template <
class TYPE>
1398 static_cast<
bsl::optional<TYPE>&>(
MoveUtil::access(original))))
1401template <
class TYPE>
1411template <
class TYPE>
1412template <
class BDE_OTHER_TYPE>
1423template <
class TYPE>
1424template <
class BDE_OTHER_TYPE>
1436template <
class TYPE>
1437template <
class BDE_OTHER_TYPE>
1448template <
class TYPE>
1449template <
class BDE_OTHER_TYPE>
1458:
Base(
bsl::allocator_arg, allocator, value)
1461template <
class TYPE>
1462template <
class BDE_OTHER_TYPE>
1474template <
class TYPE>
1475template <
class BDE_OTHER_TYPE>
1486 MoveUtil::move(static_cast<
bsl::optional<BDE_OTHER_TYPE>&>(
1490template <
class TYPE>
1491template <
class BDE_OTHER_TYPE>
1502template <
class TYPE>
1503template <
class BDE_OTHER_TYPE>
1516template <
class TYPE>
1517template <
class BDE_OTHER_TYPE>
1521:
Base(static_cast<const
bsl::optional<BDE_OTHER_TYPE>&>(original))
1524template <
class TYPE>
1525template <
class BDE_OTHER_TYPE>
1532 static_cast<const
bsl::optional<BDE_OTHER_TYPE>&>(original))
1535template <
class TYPE>
1541template <
class TYPE>
1546:
Base(bsl::allocator_arg, allocator)
1550template <
class TYPE>
1558 if (rhs.has_value()) {
1559 if (this->has_value()) {
1560 this->value() = rhs.value();
1563 this->emplace(rhs.value());
1573template <
class TYPE>
1584 if (localRhs.has_value()) {
1585 if (this->has_value()) {
1586 this->value() = MoveUtil::move(localRhs.
value());
1589 this->emplace(MoveUtil::move(localRhs.
value()));
1599template <
class TYPE>
1600template <
class BDE_OTHER_TYPE>
1608 if (rhs.has_value()) {
1609 if (this->has_value()) {
1610 this->value() = rhs.value();
1613 this->emplace(rhs.value());
1623template <
class TYPE>
1624template <
class BDE_OTHER_TYPE>
1634 if (rhsLocal.has_value()) {
1635 if (this->has_value()) {
1636 this->value() = MoveUtil::move(rhsLocal.
value());
1639 this->emplace(MoveUtil::move(rhsLocal.
value()));
1649template <
class TYPE>
1650template <
class BDE_OTHER_TYPE>
1662template <
class TYPE>
1663template <
class BDE_OTHER_TYPE>
1671 base = MoveUtil::move(rhs);
1676template <
class TYPE>
1684 if (this->has_value()) {
1685 this->value() = rhs;
1694template <
class TYPE>
1703 if (this->has_value()) {
1704 this->value() = MoveUtil::move(rhs);
1707 this->emplace(MoveUtil::move(rhs));
1713template <
class TYPE>
1714template <
class BDE_OTHER_TYPE>
1722 if (this->has_value()) {
1723 this->value() = rhs;
1732template <
class TYPE>
1742template <
class TYPE>
1743template <
class STREAM>
1750 stream.getInt8(isNull);
1754 bdexStreamIn(stream, this->emplace(), version);
1764template <
class TYPE>
1765template <
class BDE_OTHER_TYPE>
1773template <
class TYPE>
1777 return this->emplace();
1780#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1781template <
class TYPE>
1782template <
class... ARGS>
1790template <
class TYPE>
1794#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1797 return this->dereferenceRaw();
1803template <
class TYPE>
1807 return this->has_value() ? this-> operator->() : address;
1810template <
class TYPE>
1811template <
class STREAM>
1816 const bool isNull = !this->has_value();
1818 stream.putInt8(isNull ? 1 : 0);
1821 bdexStreamOut(stream, this->value(), version);
1827template <
class TYPE>
1831 return !this->has_value();
1834template <
class TYPE>
1844 return maxSupportedBdexVersion(
reinterpret_cast<TYPE *
>(0),
1848#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1849template <
class TYPE>
1859 return maxSupportedBdexVersion(
reinterpret_cast<TYPE *
>(0));
1863template <
class TYPE>
1866 int spacesPerLevel)
const
1868 if (!this->has_value()) {
1876 stream, this->value(), level, spacesPerLevel);
1879template <
class TYPE>
1883#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1886 return this->dereferenceRaw();
1892template <
class TYPE>
1896 return this->value_or(value);
1899template <
class TYPE>
1903 return this->has_value() ? this-> operator->() : value;
1906template <
class TYPE>
1910 return this->has_value() ? this-> operator->() : 0;
1916template <
class LHS_TYPE,
class RHS_TYPE>
1919 const NullableValue<RHS_TYPE>& rhs)
1920#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1922 { *lhs == *rhs } -> NullableValue_ConvertibleToBool;
1931template <
class LHS_TYPE,
class RHS_TYPE>
1935#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1937 { *
lhs == *
rhs } -> NullableValue_ConvertibleToBool;
1944template <
class LHS_TYPE,
class RHS_TYPE>
1947 const NullableValue<RHS_TYPE>& rhs)
1948#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1950 { *
lhs == *
rhs } -> NullableValue_ConvertibleToBool;
1957#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
1958template <
class LHS_TYPE,
class RHS_TYPE>
1961 const std::optional<RHS_TYPE>& rhs)
1962#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1964 { *
lhs == *
rhs } -> NullableValue_ConvertibleToBool;
1971template <
class LHS_TYPE,
class RHS_TYPE>
1974 const NullableValue<RHS_TYPE>& rhs)
1975#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1977 { *
lhs == *
rhs } -> NullableValue_ConvertibleToBool;
1985template <
class LHS_TYPE,
class RHS_TYPE>
1988 const NullableValue<RHS_TYPE>& rhs)
1989 #ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1991 { *
lhs != *
rhs } -> NullableValue_ConvertibleToBool;
1999template <
class LHS_TYPE,
class RHS_TYPE>
2002 const NullableValue<RHS_TYPE>& rhs)
2003#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2005 { *
lhs != *
rhs } -> NullableValue_ConvertibleToBool;
2012template <
class LHS_TYPE,
class RHS_TYPE>
2016#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2018 { *
lhs != *
rhs } -> NullableValue_ConvertibleToBool;
2025#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
2026template <
class LHS_TYPE,
class RHS_TYPE>
2029 const NullableValue<RHS_TYPE>& rhs)
2030#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2032 { *
lhs != *
rhs } -> NullableValue_ConvertibleToBool;
2039template <
class LHS_TYPE,
class RHS_TYPE>
2042 const std::optional<RHS_TYPE>& rhs)
2043#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2045 { *
lhs != *
rhs } -> NullableValue_ConvertibleToBool;
2053template <
class LHS_TYPE,
class RHS_TYPE>
2055bool bdlb::operator==(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2056#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2057 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2058 requires { { *
lhs ==
rhs } -> NullableValue_ConvertibleToBool; }
2064template <
class LHS_TYPE,
class RHS_TYPE>
2066bool bdlb::operator==(
const LHS_TYPE& lhs,
const NullableValue<RHS_TYPE>& rhs)
2067#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2068 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2069 requires { {
lhs == *
rhs } -> NullableValue_ConvertibleToBool; }
2075template <
class LHS_TYPE,
class RHS_TYPE>
2077bool bdlb::operator!=(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2078#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2079 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2080 requires { { *
lhs !=
rhs } -> NullableValue_ConvertibleToBool; }
2086template <
class LHS_TYPE,
class RHS_TYPE>
2088bool bdlb::operator!=(
const LHS_TYPE& lhs,
const NullableValue<RHS_TYPE>& rhs)
2089#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2090 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2091 requires { {
lhs != *
rhs } -> NullableValue_ConvertibleToBool; }
2097template <
class LHS_TYPE,
class RHS_TYPE>
2100 const NullableValue<RHS_TYPE>& rhs)
2101#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2103 { *
lhs < *
rhs } -> NullableValue_ConvertibleToBool;
2111template <
class LHS_TYPE,
class RHS_TYPE>
2114 const NullableValue<RHS_TYPE>& rhs)
2115#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2117 { *
lhs < *
rhs } -> NullableValue_ConvertibleToBool;
2121 return lhs < static_cast<const bsl::optional<RHS_TYPE>&>(
rhs);
2124template <
class LHS_TYPE,
class RHS_TYPE>
2128#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2130 { *
lhs < *
rhs } -> NullableValue_ConvertibleToBool;
2137#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
2138template <
class LHS_TYPE,
class RHS_TYPE>
2141 const NullableValue<RHS_TYPE>& rhs)
2142#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2144 { *
lhs < *
rhs } -> NullableValue_ConvertibleToBool;
2148 return lhs < static_cast<const bsl::optional<RHS_TYPE>&>(
rhs);
2151template <
class LHS_TYPE,
class RHS_TYPE>
2154 const std::optional<RHS_TYPE>& rhs)
2155#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2157 { *
lhs < *
rhs } -> NullableValue_ConvertibleToBool;
2165template <
class LHS_TYPE,
class RHS_TYPE>
2167bool bdlb::operator<(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2168#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2169 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2170 requires { { *
lhs <
rhs } -> NullableValue_ConvertibleToBool; }
2176template <
class LHS_TYPE,
class RHS_TYPE>
2178bool bdlb::operator<(
const LHS_TYPE& lhs,
const NullableValue<RHS_TYPE>& rhs)
2179#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2180 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2181 requires { {
lhs < *
rhs } -> NullableValue_ConvertibleToBool; }
2184 return lhs < static_cast<const bsl::optional<RHS_TYPE>&>(
rhs);
2187template <
class LHS_TYPE,
class RHS_TYPE>
2190 const NullableValue<RHS_TYPE>& rhs)
2191#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2193 { *
lhs > *
rhs } -> NullableValue_ConvertibleToBool;
2201template <
class LHS_TYPE,
class RHS_TYPE>
2204 const NullableValue<RHS_TYPE>& rhs)
2205#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2207 { *
lhs > *
rhs } -> NullableValue_ConvertibleToBool;
2214template <
class LHS_TYPE,
class RHS_TYPE>
2218#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2220 { *
lhs > *
rhs } -> NullableValue_ConvertibleToBool;
2227#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
2228template <
class LHS_TYPE,
class RHS_TYPE>
2231 const NullableValue<RHS_TYPE>& rhs)
2232#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2234 { *
lhs > *
rhs } -> NullableValue_ConvertibleToBool;
2241template <
class LHS_TYPE,
class RHS_TYPE>
2244 const std::optional<RHS_TYPE>& rhs)
2245#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2247 { *
lhs > *
rhs } -> NullableValue_ConvertibleToBool;
2255template <
class LHS_TYPE,
class RHS_TYPE>
2258 const RHS_TYPE& rhs)
2259#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2260 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2261 requires { { *
lhs >
rhs } -> NullableValue_ConvertibleToBool; }
2267template <
class LHS_TYPE,
class RHS_TYPE>
2270 const NullableValue<RHS_TYPE>& rhs)
2271#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2272 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2273 requires { {
lhs > *
rhs } -> NullableValue_ConvertibleToBool; }
2279template <
class LHS_TYPE,
class RHS_TYPE>
2282 const NullableValue<RHS_TYPE>& rhs)
2283#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2285 { *
lhs <= *
rhs } -> NullableValue_ConvertibleToBool;
2293template <
class LHS_TYPE,
class RHS_TYPE>
2296 const NullableValue<RHS_TYPE>& rhs)
2297#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2299 { *
lhs <= *
rhs } -> NullableValue_ConvertibleToBool;
2303 return lhs <= static_cast<const bsl::optional<RHS_TYPE>&>(
rhs);
2306template <
class LHS_TYPE,
class RHS_TYPE>
2310#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2312 { *
lhs <= *
rhs } -> NullableValue_ConvertibleToBool;
2319#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
2320template <
class LHS_TYPE,
class RHS_TYPE>
2323 const NullableValue<RHS_TYPE>& rhs)
2324#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2326 { *
lhs <= *
rhs } -> NullableValue_ConvertibleToBool;
2330 return lhs <= static_cast<const bsl::optional<RHS_TYPE>&>(
rhs);
2333template <
class LHS_TYPE,
class RHS_TYPE>
2336 const std::optional<RHS_TYPE>& rhs)
2337#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2339 { *
lhs <= *
rhs } -> NullableValue_ConvertibleToBool;
2347template <
class LHS_TYPE,
class RHS_TYPE>
2350 const RHS_TYPE& rhs)
2351#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2352 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2353 requires { { *
lhs <=
rhs } -> NullableValue_ConvertibleToBool; }
2359template <
class LHS_TYPE,
class RHS_TYPE>
2362 const NullableValue<RHS_TYPE>& rhs)
2363#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2364 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2365 requires { {
lhs <= *
rhs } -> NullableValue_ConvertibleToBool; }
2368 return lhs <= static_cast<const bsl::optional<RHS_TYPE>&>(
rhs);
2372template <
class LHS_TYPE,
class RHS_TYPE>
2375 const NullableValue<RHS_TYPE>& rhs)
2376#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2378 { *
lhs >= *
rhs } -> NullableValue_ConvertibleToBool;
2386template <
class LHS_TYPE,
class RHS_TYPE>
2389 const NullableValue<RHS_TYPE>& rhs)
2390#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2392 { *
lhs >= *
rhs } -> NullableValue_ConvertibleToBool;
2399template <
class LHS_TYPE,
class RHS_TYPE>
2403#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2405 { *
lhs >= *
rhs } -> NullableValue_ConvertibleToBool;
2412#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
2413template <
class LHS_TYPE,
class RHS_TYPE>
2416 const NullableValue<RHS_TYPE>& rhs)
2417#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2419 { *
lhs >= *
rhs } -> NullableValue_ConvertibleToBool;
2426template <
class LHS_TYPE,
class RHS_TYPE>
2429 const std::optional<RHS_TYPE>& rhs)
2430#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2432 { *
lhs >= *
rhs } -> NullableValue_ConvertibleToBool;
2440template <
class LHS_TYPE,
class RHS_TYPE>
2443 const RHS_TYPE& rhs)
2444#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2445 requires (!NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2446 requires { { *
lhs >=
rhs } -> NullableValue_ConvertibleToBool; }
2452template <
class LHS_TYPE,
class RHS_TYPE>
2455 const NullableValue<RHS_TYPE>& rhs)
2456#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2457 requires (!NullableValue_DerivedFromOptional<LHS_TYPE>) &&
2458 requires { {
lhs >= *
rhs } -> NullableValue_ConvertibleToBool; }
2465#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
2466 defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2468template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
2469constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2470bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
2471 const NullableValue<RHS_TYPE>& rhs)
2477template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
2478constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2479bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
2485template <
class LHS_TYPE, bsl::three_way_comparable_with<LHS_TYPE> RHS_TYPE>
2486constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2487bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
2488 const std::optional<RHS_TYPE>& rhs)
2493template <
class LHS_TYPE,
class RHS_TYPE>
2494 requires(!bdlb::NullableValue_DerivedFromOptional<RHS_TYPE>) &&
2495 bsl::three_way_comparable_with<LHS_TYPE, RHS_TYPE>
2496constexpr std::compare_three_way_result_t<LHS_TYPE, RHS_TYPE>
2497bdlb::operator<=>(
const NullableValue<LHS_TYPE>& lhs,
const RHS_TYPE& rhs)
2502template <
class TYPE>
2503constexpr std::strong_ordering
2504bdlb::operator<=>(
const NullableValue<TYPE>& value,
2507 return (!value.isNull()) <=>
false;
2512template <
class TYPE>
2517 return !value.has_value();
2520#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2522template <
class TYPE>
2527 return !value.has_value();
2530template <
class TYPE>
2535 return value.has_value();
2538template <
class TYPE>
2543 return value.has_value();
2546# ifndef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2548template <
class TYPE>
2556template <
class TYPE>
2561 return value.has_value();
2564template <
class TYPE>
2569 return value.has_value();
2572template <
class TYPE>
2580template <
class TYPE>
2585 return !value.has_value();
2588template <
class TYPE>
2596template <
class TYPE>
2604template <
class TYPE>
2609 return !value.has_value();
2615template <
class TYPE>
2618 const NullableValue<TYPE>&
object)
2620 return object.print(stream, 0, -1);
2624template <
class HASHALG,
class TYPE>
2627 if (!input.isNull()) {
2636template <
class TYPE>
2640bdlb::swap(NullableValue<TYPE>& lhs, NullableValue<TYPE>& rhs)
2646template <
class TYPE>
2650bdlb::swap(NullableValue<TYPE>& lhs, NullableValue<TYPE>& rhs)
2657#ifdef BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_GNU_WORKAROUND_NEEDED
2662template <
typename _Tp>
2663inline constexpr bool __is_optional_v<BloombergLP::bdlb::NullableValue<_Tp>> =
2668#ifdef BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_MSVC_WORKAROUND_NEEDED
2673template <
typename _Tp>
2675constexpr bool _Is_specialization_v<BloombergLP::bdlb::NullableValue<_Tp>,
2676 std::optional> =
true;