File indexing completed on 2025-01-18 09:43:38
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
0039
0040
0041 template <class T = void> struct equal_to {
0042
0043 bool operator()(const T& x, const T& y) const {
0044 return boost::pfr::eq(x, y);
0045 }
0046
0047 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0048
0049 typedef std::true_type is_transparent;
0050
0051
0052
0053 template <class V, class U> bool operator()(const V& x, const U& y) const;
0054 #endif
0055 };
0056
0057
0058 template <> struct equal_to<void> {
0059 template <class T, class U>
0060 bool operator()(const T& x, const U& y) const {
0061 return boost::pfr::eq(x, y);
0062 }
0063
0064 typedef std::true_type is_transparent;
0065 };
0066
0067
0068
0069 template <class T = void> struct not_equal {
0070
0071 bool operator()(const T& x, const T& y) const {
0072 return boost::pfr::ne(x, y);
0073 }
0074
0075 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0076
0077 typedef std::true_type is_transparent;
0078
0079
0080
0081 template <class V, class U> bool operator()(const V& x, const U& y) const;
0082 #endif
0083 };
0084
0085
0086 template <> struct not_equal<void> {
0087 template <class T, class U>
0088 bool operator()(const T& x, const U& y) const {
0089 return boost::pfr::ne(x, y);
0090 }
0091
0092 typedef std::true_type is_transparent;
0093 };
0094
0095
0096
0097 template <class T = void> struct greater {
0098
0099 bool operator()(const T& x, const T& y) const {
0100 return boost::pfr::gt(x, y);
0101 }
0102
0103 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0104
0105 typedef std::true_type is_transparent;
0106
0107
0108
0109 template <class V, class U> bool operator()(const V& x, const U& y) const;
0110 #endif
0111 };
0112
0113
0114 template <> struct greater<void> {
0115 template <class T, class U>
0116 bool operator()(const T& x, const U& y) const {
0117 return boost::pfr::gt(x, y);
0118 }
0119
0120 typedef std::true_type is_transparent;
0121 };
0122
0123
0124
0125 template <class T = void> struct less {
0126
0127 bool operator()(const T& x, const T& y) const {
0128 return boost::pfr::lt(x, y);
0129 }
0130
0131 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0132
0133 typedef std::true_type is_transparent;
0134
0135
0136
0137 template <class V, class U> bool operator()(const V& x, const U& y) const;
0138 #endif
0139 };
0140
0141
0142 template <> struct less<void> {
0143 template <class T, class U>
0144 bool operator()(const T& x, const U& y) const {
0145 return boost::pfr::lt(x, y);
0146 }
0147
0148 typedef std::true_type is_transparent;
0149 };
0150
0151
0152
0153 template <class T = void> struct greater_equal {
0154
0155
0156 bool operator()(const T& x, const T& y) const {
0157 return boost::pfr::ge(x, y);
0158 }
0159
0160 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0161
0162 typedef std::true_type is_transparent;
0163
0164
0165
0166 template <class V, class U> bool operator()(const V& x, const U& y) const;
0167 #endif
0168 };
0169
0170
0171 template <> struct greater_equal<void> {
0172 template <class T, class U>
0173 bool operator()(const T& x, const U& y) const {
0174 return boost::pfr::ge(x, y);
0175 }
0176
0177 typedef std::true_type is_transparent;
0178 };
0179
0180
0181
0182 template <class T = void> struct less_equal {
0183
0184
0185 bool operator()(const T& x, const T& y) const {
0186 return boost::pfr::le(x, y);
0187 }
0188
0189 #ifdef BOOST_PFR_DOXYGEN_INVOKED
0190
0191 typedef std::true_type is_transparent;
0192
0193
0194
0195 template <class V, class U> bool operator()(const V& x, const U& y) const;
0196 #endif
0197 };
0198
0199
0200 template <> struct less_equal<void> {
0201 template <class T, class U>
0202 bool operator()(const T& x, const U& y) const {
0203 return boost::pfr::le(x, y);
0204 }
0205
0206 typedef std::true_type is_transparent;
0207 };
0208
0209
0210
0211
0212 template <class T> struct hash {
0213
0214 std::size_t operator()(const T& x) const {
0215 return boost::pfr::hash_value(x);
0216 }
0217 };
0218
0219 }}
0220
0221 #endif