File indexing completed on 2025-10-13 09:00:45
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PFR_FUNCTORS_HPP
0007 #define BOOST_PFR_FUNCTORS_HPP
0008 #pragma once
0009
0010 #include <boost/pfr/detail/config.hpp>
0011
0012 #include <boost/pfr/ops.hpp>
0013
0014 #include <boost/pfr/detail/functional.hpp>
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 namespace boost { namespace pfr {
0037
0038 BOOST_PFR_BEGIN_MODULE_EXPORT
0039
0040
0041
0042
0043 template <class T = void> struct equal_to {
0044
0045 bool operator()(const T& x, const T& y) const {
0046 return boost::pfr::eq(x, y);
0047 }
0048
0049 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0050
0051 typedef std::true_type is_transparent;
0052
0053
0054
0055 template <class V, class U> bool operator()(const V& x, const U& y) const;
0056 #endif
0057 };
0058
0059
0060 template <> struct equal_to<void> {
0061 template <class T, class U>
0062 bool operator()(const T& x, const U& y) const {
0063 return boost::pfr::eq(x, y);
0064 }
0065
0066 typedef std::true_type is_transparent;
0067 };
0068
0069
0070
0071 template <class T = void> struct not_equal {
0072
0073 bool operator()(const T& x, const T& y) const {
0074 return boost::pfr::ne(x, y);
0075 }
0076
0077 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0078
0079 typedef std::true_type is_transparent;
0080
0081
0082
0083 template <class V, class U> bool operator()(const V& x, const U& y) const;
0084 #endif
0085 };
0086
0087
0088 template <> struct not_equal<void> {
0089 template <class T, class U>
0090 bool operator()(const T& x, const U& y) const {
0091 return boost::pfr::ne(x, y);
0092 }
0093
0094 typedef std::true_type is_transparent;
0095 };
0096
0097
0098
0099 template <class T = void> struct greater {
0100
0101 bool operator()(const T& x, const T& y) const {
0102 return boost::pfr::gt(x, y);
0103 }
0104
0105 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0106
0107 typedef std::true_type is_transparent;
0108
0109
0110
0111 template <class V, class U> bool operator()(const V& x, const U& y) const;
0112 #endif
0113 };
0114
0115
0116 template <> struct greater<void> {
0117 template <class T, class U>
0118 bool operator()(const T& x, const U& y) const {
0119 return boost::pfr::gt(x, y);
0120 }
0121
0122 typedef std::true_type is_transparent;
0123 };
0124
0125
0126
0127 template <class T = void> struct less {
0128
0129 bool operator()(const T& x, const T& y) const {
0130 return boost::pfr::lt(x, y);
0131 }
0132
0133 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0134
0135 typedef std::true_type is_transparent;
0136
0137
0138
0139 template <class V, class U> bool operator()(const V& x, const U& y) const;
0140 #endif
0141 };
0142
0143
0144 template <> struct less<void> {
0145 template <class T, class U>
0146 bool operator()(const T& x, const U& y) const {
0147 return boost::pfr::lt(x, y);
0148 }
0149
0150 typedef std::true_type is_transparent;
0151 };
0152
0153
0154
0155 template <class T = void> struct greater_equal {
0156
0157
0158 bool operator()(const T& x, const T& y) const {
0159 return boost::pfr::ge(x, y);
0160 }
0161
0162 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0163
0164 typedef std::true_type is_transparent;
0165
0166
0167
0168 template <class V, class U> bool operator()(const V& x, const U& y) const;
0169 #endif
0170 };
0171
0172
0173 template <> struct greater_equal<void> {
0174 template <class T, class U>
0175 bool operator()(const T& x, const U& y) const {
0176 return boost::pfr::ge(x, y);
0177 }
0178
0179 typedef std::true_type is_transparent;
0180 };
0181
0182
0183
0184 template <class T = void> struct less_equal {
0185
0186
0187 bool operator()(const T& x, const T& y) const {
0188 return boost::pfr::le(x, y);
0189 }
0190
0191 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0192
0193 typedef std::true_type is_transparent;
0194
0195
0196
0197 template <class V, class U> bool operator()(const V& x, const U& y) const;
0198 #endif
0199 };
0200
0201
0202 template <> struct less_equal<void> {
0203 template <class T, class U>
0204 bool operator()(const T& x, const U& y) const {
0205 return boost::pfr::le(x, y);
0206 }
0207
0208 typedef std::true_type is_transparent;
0209 };
0210
0211
0212
0213
0214 template <class T> struct hash {
0215
0216 std::size_t operator()(const T& x) const {
0217 return boost::pfr::hash_value(x);
0218 }
0219 };
0220
0221 BOOST_PFR_END_MODULE_EXPORT
0222
0223 }}
0224
0225 #endif