MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / dm

Class dm

extern/boost/boost/bind/mem_fn.hpp:328–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326{
327
328template<class R, class T> class dm
329{
330public:
331
332 typedef R const & result_type;
333 typedef T const * argument_type;
334
335private:
336
337 typedef R (T::*F);
338 F f_;
339
340 template<class U> R const & call(U & u, T const *) const
341 {
342 return (u.*f_);
343 }
344
345 template<class U> R const & call(U & u, void const *) const
346 {
347 return (get_pointer(u)->*f_);
348 }
349
350public:
351
352 explicit dm(F f): f_(f) {}
353
354 R & operator()(T * p) const
355 {
356 return (p->*f_);
357 }
358
359 R const & operator()(T const * p) const
360 {
361 return (p->*f_);
362 }
363
364 template<class U> R const & operator()(U const & u) const
365 {
366 return call(u, &u);
367 }
368
369#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200)
370
371 R & operator()(T & t) const
372 {
373 return (t.*f_);
374 }
375
376 R const & operator()(T const & t) const
377 {
378 return (t.*f_);
379 }
380
381#endif
382
383 bool operator==(dm const & rhs) const
384 {
385 return f_ == rhs.f_;

Callers

nothing calls this directly

Calls 3

callFunction · 0.85
get_pointerFunction · 0.50
BOOST_WORKAROUNDFunction · 0.50

Tested by

no test coverage detected