|
template<class T , std::size_t... I> |
constexpr bool | sequoia::has_heterogeneous_deep_equality (std::index_sequence< I... >) |
|
The stl currently underconstrains operator==
. For example, consider a type, T
, which is not equality comparable. Nevertheless, In C++20, std::vector<T>
counter-intuitively satisfies the std::equality_comparable
concept. To work around this defect, machinery is provided for checking deep equality. This exploits the uniformity of the stl:
- If a type defines a nested type
value_type
it is treated as a homogeneous container.
- If a type does not defines a nested type
value_type
but elements may be accessed with std::get
it is treated as a heterogeneous container.
◆ heterogeneous_deep_equality_v
template<class T , std::size_t... I>
constexpr bool sequoia::heterogeneous_deep_equality_v |
|
inlineconstexpr |
Initial value:{
requires(T & t, std::index_sequence<I...>) {
requires (is_deep_equality_comparable<std::remove_cvref_t<decltype(std::get<I>(t))>>::value && ...);
}
}