@@ -742,18 +742,6 @@ struct is_transparent<Type, std::void_t<typename Type::is_transparent>>: std::tr
742
742
template <typename Type>
743
743
inline constexpr bool is_transparent_v = is_transparent<Type>::value;
744
744
745
- /* *
746
- * @brief Provides the member constant `value` to true if a given type is
747
- * equality comparable, false otherwise.
748
- * @tparam Type The type to test.
749
- */
750
- template <typename Type>
751
- struct is_equality_comparable ;
752
-
753
- /* ! @copydoc is_equality_comparable */
754
- template <typename Type>
755
- struct is_equality_comparable <const Type>: is_equality_comparable<Type> {};
756
-
757
745
/* *
758
746
* @cond TURN_OFF_DOXYGEN
759
747
* Internal details not to be documented.
@@ -775,7 +763,7 @@ struct has_value_type<Type, std::void_t<typename Type::value_type>>: std::true_t
775
763
776
764
template <typename Type, std::size_t ... Index>
777
765
[[nodiscard]] constexpr bool unpack_maybe_equality_comparable (std::index_sequence<Index...>) {
778
- return (is_equality_comparable <std::tuple_element_t <Index, Type>>::value && ...);
766
+ return (dispatch_is_equality_comparable <std::tuple_element_t <Index, Type>>() && ...);
779
767
}
780
768
781
769
template <typename >
@@ -789,13 +777,15 @@ template<typename Type>
789
777
}
790
778
791
779
template <typename Type>
792
- [[nodiscard]] constexpr auto dispatch_is_equality_comparable () {
793
- if constexpr (has_tuple_size_value<Type>::value) {
780
+ [[nodiscard]] constexpr bool dispatch_is_equality_comparable () {
781
+ if constexpr (std::is_array_v<Type>) {
782
+ return false ;
783
+ } else if constexpr (has_tuple_size_value<Type>::value) {
794
784
return maybe_equality_comparable<Type>(0 ) && unpack_maybe_equality_comparable<Type>(std::make_index_sequence<std::tuple_size<Type>::value>{});
795
785
} else if constexpr (has_value_type<Type>::value) {
796
786
if constexpr (is_iterator_v<Type> || std::is_same_v<typename Type::value_type, Type>) {
797
787
return maybe_equality_comparable<Type>(0 );
798
- } else if constexpr (is_equality_comparable <typename Type::value_type>::value ) {
788
+ } else if constexpr (dispatch_is_equality_comparable <typename Type::value_type>() ) {
799
789
return maybe_equality_comparable<Type>(0 );
800
790
} else {
801
791
return false ;
@@ -807,17 +797,22 @@ template<typename Type>
807
797
808
798
} // namespace internal
809
799
810
- template <typename Type>
811
- struct is_equality_comparable : std::bool_constant<internal::dispatch_is_equality_comparable<Type>()> {};
812
-
813
800
/* *
814
801
* Internal details not to be documented.
815
802
* @endcond
816
803
*/
817
804
805
+ /* *
806
+ * @brief Provides the member constant `value` to true if a given type is
807
+ * equality comparable, false otherwise.
808
+ * @tparam Type The type to test.
809
+ */
810
+ template <typename Type>
811
+ struct is_equality_comparable : std::bool_constant<internal::dispatch_is_equality_comparable<Type>()> {};
812
+
818
813
/* ! @copydoc is_equality_comparable */
819
- template <typename Type, auto N >
820
- struct is_equality_comparable <Type[N] >: std::false_type {};
814
+ template <typename Type>
815
+ struct is_equality_comparable <const Type>: is_equality_comparable<Type> {};
821
816
822
817
/* *
823
818
* @brief Helper variable template.
0 commit comments