96 bool ref_eq(
const T &lhs,
const T &rhs) {
97 if constexpr (packtl::is_type<std::vector, T>::value) {
99 }
else if constexpr (packtl::is_type<std::list, T>::value) {
101 }
else if constexpr (packtl::is_type<std::deque, T>::value) {
103 }
else if constexpr (packtl::is_type<std::queue, T>::value) {
105 }
else if constexpr (packtl::is_type<std::stack, T>::value) {
107 }
else if constexpr (packtl::is_type<std::map, T>::value) {
109 }
else if constexpr (packtl::is_type<std::unordered_map, T>::value) {
111 }
else if constexpr (packtl::is_type<std::set, T>::value) {
113 }
else if constexpr (packtl::is_type<std::unordered_set, T>::value) {
115 }
else if constexpr (packtl::is_type<std::pair, T>::value) {
117 }
else if constexpr (packtl::is_type<std::function, T>::value) {
119 }
else if constexpr (packtl::is_type<std::tuple, T>::value) {
121 }
else if constexpr (std::equality_comparable<T>) {
132 const auto &field1 = field_data::from_instance(lhs);
133 const auto &field2 = field_data::from_instance(rhs);
136 if constexpr (field_data::template has_metadata<eq_policy::policy_e>) {
137 policy = field_data::template get_metadata<eq_policy::policy_e>;
144 if constexpr (field_data::is_reference) {
146 if (&field1 == &field2) {
150 using field_type = std::remove_reference_t<typename field_data::type>;
153 return &field1 == &field2;
155 }
else if constexpr (field_data::is_pointer) {
157 if (field1 == field2) {
161 using field_type = std::remove_pointer_t<typename field_data::type>;
162 if constexpr (std::is_void_v<field_type>) {
168 return field1 == field2;
171 using field_type =
typename field_data::type;