72 template<Type::SafeValue First, Type::SafeValue Second>
91 Pair(
const First& firstValue,
const Second& secondValue);
98 Pair(First&& firstValue, Second&& secondValue)
noexcept(
99 std::is_nothrow_move_constructible_v<First> &&
100 std::is_nothrow_move_constructible_v<Second>);
109 template<
class U,
class V>
112 Pair(U&& firstValue, V&& secondValue);
122 template<
class... FirstArgs,
class... SecondArgs>
123 Pair(std::piecewise_construct_t tag, std::tuple<FirstArgs...> firstArgs, std::tuple<SecondArgs...> secondArgs);
131 template<
class OtherFirst,
class OtherSecond>
135 Pair(
const std::pair<OtherFirst, OtherSecond>& other);
143 template<
class OtherFirst,
class OtherSecond>
147 Pair(std::pair<OtherFirst, OtherSecond>&& other);
155 template<
class OtherFirst,
class OtherSecond>
167 template<
class OtherFirst,
class OtherSecond>
183 Pair(
Pair&& other)
noexcept(std::is_nothrow_move_constructible_v<First> &&
184 std::is_nothrow_move_constructible_v<Second>) =
default;
204 std::is_nothrow_move_assignable_v<Second>) =
default;
213 template<
class OtherFirst,
class OtherSecond>
225 template<
class OtherFirst,
class OtherSecond>
237 template<
class OtherFirst,
class OtherSecond>
249 template<
class OtherFirst,
class OtherSecond>
265 friend void swap(
Pair& left,
Pair& right)
noexcept(
noexcept(left.swap(right))) {
301 template<
class... FirstArgs,
class... SecondArgs, std::size_t... FirstIndexes, std::size_t... SecondIndexes>
302 Pair(std::piecewise_construct_t tag, std::tuple<FirstArgs...>& firstArgs, std::tuple<SecondArgs...>& secondArgs,
303 std::index_sequence<FirstIndexes...>, std::index_sequence<SecondIndexes...>);
313 template<Type::SafeValue First, Type::SafeValue Second,
class SecondReference>
327 PairReference(
const First& firstValue,
const Second& secondValue, SecondReference secondReference);
353 template<std::
size_t Index>
354 requires (Index == 0)
356 return reference.
first;
365 template<std::
size_t Index>
366 requires (Index == 1)
377 template<std::
size_t Index>
378 requires (Index == 0)
380 return std::move(reference.
first);
389 template<std::
size_t Index>
390 requires (Index == 1)
392 return std::move(reference.
second);
401 template<std::
size_t Index>
402 requires (Index == 0)
404 return std::move(reference.
first);
413 template<std::
size_t Index>
414 requires (Index == 1)
429 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
430 requires (Index == 0)
439 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
440 requires (Index == 1)
449 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
450 requires (Index == 0)
459 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
460 requires (Index == 1)
469 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
470 requires (Index == 0)
479 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
480 requires (Index == 1)
489 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
490 requires (Index == 0)
499 template<std::
size_t Index, Type::SafeValue First, Type::SafeValue Second>
500 requires (Index == 1)
514 template<SafeValue First, SafeValue Second>
515 requires IsSafe<First>::value && IsSafe<Second>::value
523 template<SafeValue First, SafeValue Second>
532 template<SafeValue First, SafeValue Second>
542template<StormByte::Type::SafeValue First, StormByte::Type::SafeValue Second>
543struct std::tuple_size<
StormByte::Safe::Pair<First, Second>>: std::integral_constant<std::size_t, 2> {};
551template<StormByte::Type::SafeValue First, StormByte::Type::SafeValue Second,
class SecondReference>
552struct std::tuple_size<
StormByte::Safe::PairReference<First, Second, SecondReference>>:
553 std::integral_constant<std::size_t, 2> {};
561template<std::
size_t Index, StormByte::Type::SafeValue First, StormByte::Type::SafeValue Second>
564 using type = std::conditional_t<Index == 0, First, Second>;
574template<std::
size_t Index, StormByte::Type::SafeValue First, StormByte::Type::SafeValue Second,
class SecondReference>
577 using type = std::conditional_t<Index == 0, const First, SecondReference>;
585template<StormByte::Type::SafeValue First, StormByte::Type::SafeValue Second>
602template<StormByte::Type::SafeValue First, StormByte::Type::SafeValue Second>
Tuple-like proxy for an immutable first value and callback-backed second value.
Definition pair.hxx:314
friend const First && get(const PairReference &&reference) noexcept
Read the first component of a const temporary proxy.
Definition pair.hxx:403
SecondReference second
Callback-backed second value proxy.
Definition pair.hxx:319
Pair< First, Second > value_type
Copied entry value type.
Definition pair.hxx:316
friend SecondReference get(const PairReference &&reference)
Read the second component of a const temporary proxy.
Definition pair.hxx:415
PairReference(PairReference &&other)=default
Move a pair-reference proxy.
friend const First && get(PairReference &&reference) noexcept
Move-access the first component of a temporary proxy.
Definition pair.hxx:379
const First first
Immutable first value copy.
Definition pair.hxx:318
friend SecondReference get(PairReference &&reference) noexcept
Move-access the second component of a temporary proxy.
Definition pair.hxx:391
PairReference(const PairReference &other)=default
Copy a pair-reference proxy.
friend const First & get(const PairReference &reference) noexcept
Access the first component for structured bindings.
Definition pair.hxx:355
PairReference(const First &firstValue, const Second &secondValue, SecondReference secondReference)
Bind the proxy to copied values and a mutable second-value proxy.
friend SecondReference & get(PairReference &reference) noexcept
Access the second component for structured bindings.
Definition pair.hxx:367
std::pair whose members keep their own Safe storage.
Definition pair.hxx:73
Pair(U &&firstValue, V &&secondValue)
Construct both members from convertible values.
First first_type
Definition pair.hxx:75
Pair(std::piecewise_construct_t tag, std::tuple< FirstArgs... > firstArgs, std::tuple< SecondArgs... > secondArgs)
Construct both members from argument tuples.
Second second
Definition pair.hxx:79
STORMBYTE_FORCE_INLINE auto operator<=>(const Pair &other) const
Order by the first member, then the second.
First first
Definition pair.hxx:78
Pair(Pair< OtherFirst, OtherSecond > &&other)
Move a compatible Safe pair.
Pair()
Value-initialize both members.
Definition pair.hxx:84
Pair(const Pair< OtherFirst, OtherSecond > &other)
Copy a compatible Safe pair.
Pair(First &&firstValue, Second &&secondValue) noexcept(std::is_nothrow_move_constructible_v< First > &&std::is_nothrow_move_constructible_v< Second >)
Move two values into the pair.
friend void swap(Pair &left, Pair &right) noexcept(noexcept(left.swap(right)))
Exchange two pairs.
Definition pair.hxx:265
Pair(const Pair &other)=default
Copy a pair.
Pair(std::pair< OtherFirst, OtherSecond > &&other)
Move a caller-owned STL pair.
Pair(const First &firstValue, const Second &secondValue)
Copy two values into the pair.
Pair & operator=(std::pair< OtherFirst, OtherSecond > &&other)
Move-assign a caller-owned STL pair.
Pair & operator=(const std::pair< OtherFirst, OtherSecond > &other)
Copy-assign a caller-owned STL pair.
Second second_type
Definition pair.hxx:76
Pair & operator=(Pair< OtherFirst, OtherSecond > &&other)
Move-assign a compatible Safe pair.
Pair(const std::pair< OtherFirst, OtherSecond > &other)
Copy a caller-owned STL pair.
void swap(Pair &other) noexcept(Type::Swappable< First > &&Type::Swappable< Second >)
Exchange both members.
Pair & operator=(const Pair &other)=default
Copy-assign a pair.
Pair(Pair &&other) noexcept(std::is_nothrow_move_constructible_v< First > &&std::is_nothrow_move_constructible_v< Second >)=default
Move a pair.
bool operator==(const Pair &other) const
Compare both members.
Pair & operator=(Pair &&other) noexcept(std::is_nothrow_move_assignable_v< First > &&std::is_nothrow_move_assignable_v< Second >)=default
Move-assign a pair.
~Pair()=default
Destroy both members through their own Safe operations.
Pair & operator=(const Pair< OtherFirst, OtherSecond > &other)
Copy-assign a compatible Safe pair.
T can be assigned from U (std::assignable_from).
Definition object_semantics.hxx:372
Type constructible from Args (std::constructible_from).
Definition object_semantics.hxx:356
From is implicitly convertible to To (std::is_convertible).
Definition conversions.hxx:74
Type whose == and != both yield something convertible to bool.
Definition comparison.hxx:81
Recognizes a conditional Safe component after stripping cv and references.
Definition safe.hxx:301
Type with accessible first and second members.
Definition wrappers.hxx:215
Type that can be swapped with std::swap (std::is_swappable).
Definition object_semantics.hxx:328
Type whose <=> operator is well-formed.
Definition comparison.hxx:97
Owned values that cross a DLL without the caller's CRT.
STORMBYTE_FORCE_INLINE std::size_t HashCombine(std::size_t seed, std::size_t next) noexcept
Mix an existing hash with another.
Definition hash.hxx:83
constexpr First & get(Pair< First, Second > &pair) noexcept
Access the first pair member.
Root namespace of the StormByte suite.
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.
STORMBYTE_FORCE_INLINE std::size_t operator()(const StormByte::Safe::Pair< First, Second > &value) const noexcept
Hash value.
Definition pair.hxx:592
Cross-module hash.
Definition hash.hxx:95
Recognizes types whose DLL-boundary safety depends on documented provider requirements.
Definition safe.hxx:262
Recognizes collection values with Base-controlled lifetime.
Definition safe.hxx:347
Recognizes Base Safe components, not universal ABI compatibility.
Definition safe.hxx:138
std::size_t operator()(const StormByte::Safe::Pair< First, Second > &value) const noexcept
Hash value.
Definition pair.hxx:609
std::conditional_t< Index==0, const First, SecondReference > type
Definition pair.hxx:577
std::conditional_t< Index==0, First, Second > type
Definition pair.hxx:564
#define STORMBYTE_PUBLIC_TYPE
Definition visibility.h:57