Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | // |
| 2 | // bind/mem_fn_template.hpp |
| 3 | // |
| 4 | // Do not include this header directly |
| 5 | // |
| 6 | // Copyright (c) 2001 Peter Dimov and Multi Media Ltd. |
| 7 | // |
| 8 | // Distributed under the Boost Software License, Version 1.0. (See |
| 9 | // accompanying file LICENSE_1_0.txt or copy at |
| 10 | // http://www.boost.org/LICENSE_1_0.txt) |
| 11 | // |
| 12 | // See http://www.boost.org/libs/bind/mem_fn.html for documentation. |
| 13 | // |
| 14 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 15 | #if !defined(NDNBOOST_NO_FUNCTION_TEMPLATE_ORDERING) |
| 16 | # define NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 17 | #endif |
| 18 | |
| 19 | // mf0 |
| 20 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 21 | template<class R, class T NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf0) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 22 | { |
| 23 | public: |
| 24 | |
| 25 | typedef R result_type; |
| 26 | typedef T * argument_type; |
| 27 | |
| 28 | private: |
| 29 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 30 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) ()) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 31 | F f_; |
| 32 | |
| 33 | template<class U> R call(U & u, T const *) const |
| 34 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 35 | NDNBOOST_MEM_FN_RETURN (u.*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | template<class U> R call(U & u, void const *) const |
| 39 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 40 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | public: |
| 44 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 45 | explicit NDNBOOST_MEM_FN_NAME(mf0)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 46 | |
| 47 | R operator()(T * p) const |
| 48 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 49 | NDNBOOST_MEM_FN_RETURN (p->*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | template<class U> R operator()(U & u) const |
| 53 | { |
| 54 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 55 | NDNBOOST_MEM_FN_RETURN call(u, p); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 56 | } |
| 57 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 58 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 59 | |
| 60 | template<class U> R operator()(U const & u) const |
| 61 | { |
| 62 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 63 | NDNBOOST_MEM_FN_RETURN call(u, p); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | #endif |
| 67 | |
| 68 | R operator()(T & t) const |
| 69 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 70 | NDNBOOST_MEM_FN_RETURN (t.*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 71 | } |
| 72 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 73 | bool operator==(NDNBOOST_MEM_FN_NAME(mf0) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 74 | { |
| 75 | return f_ == rhs.f_; |
| 76 | } |
| 77 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 78 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf0) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 79 | { |
| 80 | return f_ != rhs.f_; |
| 81 | } |
| 82 | }; |
| 83 | |
| 84 | // cmf0 |
| 85 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 86 | template<class R, class T NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf0) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 87 | { |
| 88 | public: |
| 89 | |
| 90 | typedef R result_type; |
| 91 | typedef T const * argument_type; |
| 92 | |
| 93 | private: |
| 94 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 95 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) () const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 96 | F f_; |
| 97 | |
| 98 | template<class U> R call(U & u, T const *) const |
| 99 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 100 | NDNBOOST_MEM_FN_RETURN (u.*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | template<class U> R call(U & u, void const *) const |
| 104 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 105 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | public: |
| 109 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 110 | explicit NDNBOOST_MEM_FN_NAME(cmf0)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 111 | |
| 112 | template<class U> R operator()(U const & u) const |
| 113 | { |
| 114 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 115 | NDNBOOST_MEM_FN_RETURN call(u, p); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | R operator()(T const & t) const |
| 119 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 120 | NDNBOOST_MEM_FN_RETURN (t.*f_)(); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 121 | } |
| 122 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 123 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf0) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 124 | { |
| 125 | return f_ == rhs.f_; |
| 126 | } |
| 127 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 128 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf0) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 129 | { |
| 130 | return f_ != rhs.f_; |
| 131 | } |
| 132 | }; |
| 133 | |
| 134 | // mf1 |
| 135 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 136 | template<class R, class T, class A1 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf1) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 137 | { |
| 138 | public: |
| 139 | |
| 140 | typedef R result_type; |
| 141 | typedef T * first_argument_type; |
| 142 | typedef A1 second_argument_type; |
| 143 | |
| 144 | private: |
| 145 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 146 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 147 | F f_; |
| 148 | |
| 149 | template<class U, class B1> R call(U & u, T const *, B1 & b1) const |
| 150 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 151 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | template<class U, class B1> R call(U & u, void const *, B1 & b1) const |
| 155 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 156 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | public: |
| 160 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 161 | explicit NDNBOOST_MEM_FN_NAME(mf1)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 162 | |
| 163 | R operator()(T * p, A1 a1) const |
| 164 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 165 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | template<class U> R operator()(U & u, A1 a1) const |
| 169 | { |
| 170 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 171 | NDNBOOST_MEM_FN_RETURN call(u, p, a1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 172 | } |
| 173 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 174 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 175 | |
| 176 | template<class U> R operator()(U const & u, A1 a1) const |
| 177 | { |
| 178 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 179 | NDNBOOST_MEM_FN_RETURN call(u, p, a1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | #endif |
| 183 | |
| 184 | R operator()(T & t, A1 a1) const |
| 185 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 186 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 187 | } |
| 188 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 189 | bool operator==(NDNBOOST_MEM_FN_NAME(mf1) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 190 | { |
| 191 | return f_ == rhs.f_; |
| 192 | } |
| 193 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 194 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf1) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 195 | { |
| 196 | return f_ != rhs.f_; |
| 197 | } |
| 198 | }; |
| 199 | |
| 200 | // cmf1 |
| 201 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 202 | template<class R, class T, class A1 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf1) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 203 | { |
| 204 | public: |
| 205 | |
| 206 | typedef R result_type; |
| 207 | typedef T const * first_argument_type; |
| 208 | typedef A1 second_argument_type; |
| 209 | |
| 210 | private: |
| 211 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 212 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 213 | F f_; |
| 214 | |
| 215 | template<class U, class B1> R call(U & u, T const *, B1 & b1) const |
| 216 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 217 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | template<class U, class B1> R call(U & u, void const *, B1 & b1) const |
| 221 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 222 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | public: |
| 226 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 227 | explicit NDNBOOST_MEM_FN_NAME(cmf1)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 228 | |
| 229 | template<class U> R operator()(U const & u, A1 a1) const |
| 230 | { |
| 231 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 232 | NDNBOOST_MEM_FN_RETURN call(u, p, a1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | R operator()(T const & t, A1 a1) const |
| 236 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 237 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 238 | } |
| 239 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 240 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf1) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 241 | { |
| 242 | return f_ == rhs.f_; |
| 243 | } |
| 244 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 245 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf1) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 246 | { |
| 247 | return f_ != rhs.f_; |
| 248 | } |
| 249 | }; |
| 250 | |
| 251 | // mf2 |
| 252 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 253 | template<class R, class T, class A1, class A2 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf2) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 254 | { |
| 255 | public: |
| 256 | |
| 257 | typedef R result_type; |
| 258 | |
| 259 | private: |
| 260 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 261 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 262 | F f_; |
| 263 | |
| 264 | template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const |
| 265 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 266 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const |
| 270 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 271 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 272 | } |
| 273 | |
| 274 | public: |
| 275 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 276 | explicit NDNBOOST_MEM_FN_NAME(mf2)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 277 | |
| 278 | R operator()(T * p, A1 a1, A2 a2) const |
| 279 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 280 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | template<class U> R operator()(U & u, A1 a1, A2 a2) const |
| 284 | { |
| 285 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 286 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 287 | } |
| 288 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 289 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 290 | |
| 291 | template<class U> R operator()(U const & u, A1 a1, A2 a2) const |
| 292 | { |
| 293 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 294 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | #endif |
| 298 | |
| 299 | R operator()(T & t, A1 a1, A2 a2) const |
| 300 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 301 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 302 | } |
| 303 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 304 | bool operator==(NDNBOOST_MEM_FN_NAME(mf2) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 305 | { |
| 306 | return f_ == rhs.f_; |
| 307 | } |
| 308 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 309 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf2) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 310 | { |
| 311 | return f_ != rhs.f_; |
| 312 | } |
| 313 | }; |
| 314 | |
| 315 | // cmf2 |
| 316 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 317 | template<class R, class T, class A1, class A2 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf2) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 318 | { |
| 319 | public: |
| 320 | |
| 321 | typedef R result_type; |
| 322 | |
| 323 | private: |
| 324 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 325 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 326 | F f_; |
| 327 | |
| 328 | template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const |
| 329 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 330 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const |
| 334 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 335 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | public: |
| 339 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 340 | explicit NDNBOOST_MEM_FN_NAME(cmf2)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 341 | |
| 342 | template<class U> R operator()(U const & u, A1 a1, A2 a2) const |
| 343 | { |
| 344 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 345 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | R operator()(T const & t, A1 a1, A2 a2) const |
| 349 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 350 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 351 | } |
| 352 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 353 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf2) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 354 | { |
| 355 | return f_ == rhs.f_; |
| 356 | } |
| 357 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 358 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf2) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 359 | { |
| 360 | return f_ != rhs.f_; |
| 361 | } |
| 362 | }; |
| 363 | |
| 364 | // mf3 |
| 365 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 366 | template<class R, class T, class A1, class A2, class A3 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf3) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 367 | { |
| 368 | public: |
| 369 | |
| 370 | typedef R result_type; |
| 371 | |
| 372 | private: |
| 373 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 374 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 375 | F f_; |
| 376 | |
| 377 | template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const |
| 378 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 379 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const |
| 383 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 384 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 385 | } |
| 386 | |
| 387 | public: |
| 388 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 389 | explicit NDNBOOST_MEM_FN_NAME(mf3)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 390 | |
| 391 | R operator()(T * p, A1 a1, A2 a2, A3 a3) const |
| 392 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 393 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3) const |
| 397 | { |
| 398 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 399 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 400 | } |
| 401 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 402 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 403 | |
| 404 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const |
| 405 | { |
| 406 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 407 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 408 | } |
| 409 | |
| 410 | #endif |
| 411 | |
| 412 | R operator()(T & t, A1 a1, A2 a2, A3 a3) const |
| 413 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 414 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 415 | } |
| 416 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 417 | bool operator==(NDNBOOST_MEM_FN_NAME(mf3) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 418 | { |
| 419 | return f_ == rhs.f_; |
| 420 | } |
| 421 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 422 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf3) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 423 | { |
| 424 | return f_ != rhs.f_; |
| 425 | } |
| 426 | }; |
| 427 | |
| 428 | // cmf3 |
| 429 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 430 | template<class R, class T, class A1, class A2, class A3 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf3) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 431 | { |
| 432 | public: |
| 433 | |
| 434 | typedef R result_type; |
| 435 | |
| 436 | private: |
| 437 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 438 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 439 | F f_; |
| 440 | |
| 441 | template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const |
| 442 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 443 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const |
| 447 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 448 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | public: |
| 452 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 453 | explicit NDNBOOST_MEM_FN_NAME(cmf3)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 454 | |
| 455 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const |
| 456 | { |
| 457 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 458 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | R operator()(T const & t, A1 a1, A2 a2, A3 a3) const |
| 462 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 463 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 464 | } |
| 465 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 466 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf3) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 467 | { |
| 468 | return f_ == rhs.f_; |
| 469 | } |
| 470 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 471 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf3) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 472 | { |
| 473 | return f_ != rhs.f_; |
| 474 | } |
| 475 | }; |
| 476 | |
| 477 | // mf4 |
| 478 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 479 | template<class R, class T, class A1, class A2, class A3, class A4 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf4) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 480 | { |
| 481 | public: |
| 482 | |
| 483 | typedef R result_type; |
| 484 | |
| 485 | private: |
| 486 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 487 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 488 | F f_; |
| 489 | |
| 490 | template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const |
| 491 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 492 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const |
| 496 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 497 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 498 | } |
| 499 | |
| 500 | public: |
| 501 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 502 | explicit NDNBOOST_MEM_FN_NAME(mf4)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 503 | |
| 504 | R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4) const |
| 505 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 506 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 507 | } |
| 508 | |
| 509 | template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const |
| 510 | { |
| 511 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 512 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 513 | } |
| 514 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 515 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 516 | |
| 517 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const |
| 518 | { |
| 519 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 520 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | #endif |
| 524 | |
| 525 | R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const |
| 526 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 527 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 528 | } |
| 529 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 530 | bool operator==(NDNBOOST_MEM_FN_NAME(mf4) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 531 | { |
| 532 | return f_ == rhs.f_; |
| 533 | } |
| 534 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 535 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf4) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 536 | { |
| 537 | return f_ != rhs.f_; |
| 538 | } |
| 539 | }; |
| 540 | |
| 541 | // cmf4 |
| 542 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 543 | template<class R, class T, class A1, class A2, class A3, class A4 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf4) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 544 | { |
| 545 | public: |
| 546 | |
| 547 | typedef R result_type; |
| 548 | |
| 549 | private: |
| 550 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 551 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 552 | F f_; |
| 553 | |
| 554 | template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const |
| 555 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 556 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 557 | } |
| 558 | |
| 559 | template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const |
| 560 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 561 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 562 | } |
| 563 | |
| 564 | public: |
| 565 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 566 | explicit NDNBOOST_MEM_FN_NAME(cmf4)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 567 | |
| 568 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const |
| 569 | { |
| 570 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 571 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 572 | } |
| 573 | |
| 574 | R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const |
| 575 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 576 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 577 | } |
| 578 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 579 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf4) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 580 | { |
| 581 | return f_ == rhs.f_; |
| 582 | } |
| 583 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 584 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf4) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 585 | { |
| 586 | return f_ != rhs.f_; |
| 587 | } |
| 588 | }; |
| 589 | |
| 590 | // mf5 |
| 591 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 592 | template<class R, class T, class A1, class A2, class A3, class A4, class A5 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf5) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 593 | { |
| 594 | public: |
| 595 | |
| 596 | typedef R result_type; |
| 597 | |
| 598 | private: |
| 599 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 600 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 601 | F f_; |
| 602 | |
| 603 | template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const |
| 604 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 605 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 606 | } |
| 607 | |
| 608 | template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const |
| 609 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 610 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 611 | } |
| 612 | |
| 613 | public: |
| 614 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 615 | explicit NDNBOOST_MEM_FN_NAME(mf5)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 616 | |
| 617 | R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const |
| 618 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 619 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 620 | } |
| 621 | |
| 622 | template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const |
| 623 | { |
| 624 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 625 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 626 | } |
| 627 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 628 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 629 | |
| 630 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const |
| 631 | { |
| 632 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 633 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 634 | } |
| 635 | |
| 636 | #endif |
| 637 | |
| 638 | R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const |
| 639 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 640 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 641 | } |
| 642 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 643 | bool operator==(NDNBOOST_MEM_FN_NAME(mf5) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 644 | { |
| 645 | return f_ == rhs.f_; |
| 646 | } |
| 647 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 648 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf5) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 649 | { |
| 650 | return f_ != rhs.f_; |
| 651 | } |
| 652 | }; |
| 653 | |
| 654 | // cmf5 |
| 655 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 656 | template<class R, class T, class A1, class A2, class A3, class A4, class A5 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf5) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 657 | { |
| 658 | public: |
| 659 | |
| 660 | typedef R result_type; |
| 661 | |
| 662 | private: |
| 663 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 664 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 665 | F f_; |
| 666 | |
| 667 | template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const |
| 668 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 669 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 670 | } |
| 671 | |
| 672 | template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const |
| 673 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 674 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 675 | } |
| 676 | |
| 677 | public: |
| 678 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 679 | explicit NDNBOOST_MEM_FN_NAME(cmf5)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 680 | |
| 681 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const |
| 682 | { |
| 683 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 684 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 685 | } |
| 686 | |
| 687 | R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const |
| 688 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 689 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 690 | } |
| 691 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 692 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf5) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 693 | { |
| 694 | return f_ == rhs.f_; |
| 695 | } |
| 696 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 697 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf5) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 698 | { |
| 699 | return f_ != rhs.f_; |
| 700 | } |
| 701 | }; |
| 702 | |
| 703 | // mf6 |
| 704 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 705 | template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf6) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 706 | { |
| 707 | public: |
| 708 | |
| 709 | typedef R result_type; |
| 710 | |
| 711 | private: |
| 712 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 713 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 714 | F f_; |
| 715 | |
| 716 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const |
| 717 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 718 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 719 | } |
| 720 | |
| 721 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const |
| 722 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 723 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 724 | } |
| 725 | |
| 726 | public: |
| 727 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 728 | explicit NDNBOOST_MEM_FN_NAME(mf6)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 729 | |
| 730 | R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const |
| 731 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 732 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const |
| 736 | { |
| 737 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 738 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 739 | } |
| 740 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 741 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 742 | |
| 743 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const |
| 744 | { |
| 745 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 746 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 747 | } |
| 748 | |
| 749 | #endif |
| 750 | |
| 751 | R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const |
| 752 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 753 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 754 | } |
| 755 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 756 | bool operator==(NDNBOOST_MEM_FN_NAME(mf6) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 757 | { |
| 758 | return f_ == rhs.f_; |
| 759 | } |
| 760 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 761 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf6) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 762 | { |
| 763 | return f_ != rhs.f_; |
| 764 | } |
| 765 | }; |
| 766 | |
| 767 | // cmf6 |
| 768 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 769 | template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf6) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 770 | { |
| 771 | public: |
| 772 | |
| 773 | typedef R result_type; |
| 774 | |
| 775 | private: |
| 776 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 777 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 778 | F f_; |
| 779 | |
| 780 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const |
| 781 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 782 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 783 | } |
| 784 | |
| 785 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const |
| 786 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 787 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 788 | } |
| 789 | |
| 790 | public: |
| 791 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 792 | explicit NDNBOOST_MEM_FN_NAME(cmf6)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 793 | |
| 794 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const |
| 795 | { |
| 796 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 797 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 798 | } |
| 799 | |
| 800 | R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const |
| 801 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 802 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 803 | } |
| 804 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 805 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf6) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 806 | { |
| 807 | return f_ == rhs.f_; |
| 808 | } |
| 809 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 810 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf6) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 811 | { |
| 812 | return f_ != rhs.f_; |
| 813 | } |
| 814 | }; |
| 815 | |
| 816 | // mf7 |
| 817 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 818 | template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf7) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 819 | { |
| 820 | public: |
| 821 | |
| 822 | typedef R result_type; |
| 823 | |
| 824 | private: |
| 825 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 826 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 827 | F f_; |
| 828 | |
| 829 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const |
| 830 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 831 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 832 | } |
| 833 | |
| 834 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const |
| 835 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 836 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 837 | } |
| 838 | |
| 839 | public: |
| 840 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 841 | explicit NDNBOOST_MEM_FN_NAME(mf7)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 842 | |
| 843 | R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const |
| 844 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 845 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 846 | } |
| 847 | |
| 848 | template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const |
| 849 | { |
| 850 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 851 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 852 | } |
| 853 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 854 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 855 | |
| 856 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const |
| 857 | { |
| 858 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 859 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 860 | } |
| 861 | |
| 862 | #endif |
| 863 | |
| 864 | R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const |
| 865 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 866 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 867 | } |
| 868 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 869 | bool operator==(NDNBOOST_MEM_FN_NAME(mf7) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 870 | { |
| 871 | return f_ == rhs.f_; |
| 872 | } |
| 873 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 874 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf7) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 875 | { |
| 876 | return f_ != rhs.f_; |
| 877 | } |
| 878 | }; |
| 879 | |
| 880 | // cmf7 |
| 881 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 882 | template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf7) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 883 | { |
| 884 | public: |
| 885 | |
| 886 | typedef R result_type; |
| 887 | |
| 888 | private: |
| 889 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 890 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 891 | F f_; |
| 892 | |
| 893 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const |
| 894 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 895 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 896 | } |
| 897 | |
| 898 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const |
| 899 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 900 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 901 | } |
| 902 | |
| 903 | public: |
| 904 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 905 | explicit NDNBOOST_MEM_FN_NAME(cmf7)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 906 | |
| 907 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const |
| 908 | { |
| 909 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 910 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 911 | } |
| 912 | |
| 913 | R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const |
| 914 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 915 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 916 | } |
| 917 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 918 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf7) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 919 | { |
| 920 | return f_ == rhs.f_; |
| 921 | } |
| 922 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 923 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf7) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 924 | { |
| 925 | return f_ != rhs.f_; |
| 926 | } |
| 927 | }; |
| 928 | |
| 929 | // mf8 |
| 930 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 931 | template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf8) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 932 | { |
| 933 | public: |
| 934 | |
| 935 | typedef R result_type; |
| 936 | |
| 937 | private: |
| 938 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 939 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 940 | F f_; |
| 941 | |
| 942 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const |
| 943 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 944 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 945 | } |
| 946 | |
| 947 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const |
| 948 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 949 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 950 | } |
| 951 | |
| 952 | public: |
| 953 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 954 | explicit NDNBOOST_MEM_FN_NAME(mf8)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 955 | |
| 956 | R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 957 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 958 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 959 | } |
| 960 | |
| 961 | template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 962 | { |
| 963 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 964 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 965 | } |
| 966 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 967 | #ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 968 | |
| 969 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 970 | { |
| 971 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 972 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 973 | } |
| 974 | |
| 975 | #endif |
| 976 | |
| 977 | R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 978 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 979 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 980 | } |
| 981 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 982 | bool operator==(NDNBOOST_MEM_FN_NAME(mf8) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 983 | { |
| 984 | return f_ == rhs.f_; |
| 985 | } |
| 986 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 987 | bool operator!=(NDNBOOST_MEM_FN_NAME(mf8) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 988 | { |
| 989 | return f_ != rhs.f_; |
| 990 | } |
| 991 | }; |
| 992 | |
| 993 | // cmf8 |
| 994 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 995 | template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf8) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 996 | { |
| 997 | public: |
| 998 | |
| 999 | typedef R result_type; |
| 1000 | |
| 1001 | private: |
| 1002 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1003 | NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1004 | F f_; |
| 1005 | |
| 1006 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const |
| 1007 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1008 | NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1009 | } |
| 1010 | |
| 1011 | template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const |
| 1012 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1013 | NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1014 | } |
| 1015 | |
| 1016 | public: |
| 1017 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1018 | explicit NDNBOOST_MEM_FN_NAME(cmf8)(F f): f_(f) {} |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1019 | |
| 1020 | R operator()(T const * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 1021 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1022 | NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1023 | } |
| 1024 | |
| 1025 | template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 1026 | { |
| 1027 | U const * p = 0; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1028 | NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1029 | } |
| 1030 | |
| 1031 | R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const |
| 1032 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1033 | NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1034 | } |
| 1035 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1036 | bool operator==(NDNBOOST_MEM_FN_NAME(cmf8) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1037 | { |
| 1038 | return f_ == rhs.f_; |
| 1039 | } |
| 1040 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1041 | bool operator!=(NDNBOOST_MEM_FN_NAME(cmf8) const & rhs) const |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1042 | { |
| 1043 | return f_ != rhs.f_; |
| 1044 | } |
| 1045 | }; |
| 1046 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1047 | #undef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS |