Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:57

0001 // Copyright 2008 Christophe Henry
0002 // henry UNDERSCORE christophe AT hotmail DOT com
0003 // This is an extended version of the state machine available in the boost::mpl library
0004 // Distributed under the same license as the original.
0005 // Copyright for the original version:
0006 // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
0007 // under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_MSM_BACK_BIND_HELPERS_H
0012 #define BOOST_MSM_BACK_BIND_HELPERS_H
0013 
0014 #include <functional>
0015 
0016 namespace boost { namespace msm { namespace back
0017 {
0018     // helper to replace std::plus as the lack of implicit conversion makes it not usable in one of our bind
0019     template<class _Ty,class _Tz>
0020     struct plus2
0021     {
0022         typedef _Ty first_argument_type;
0023         typedef _Tz second_argument_type;
0024         typedef _Ty result_type;
0025 
0026         // functor for operator+
0027         _Ty operator()( _Ty _Left, _Tz _Right) const
0028         {
0029             // apply operator+ to operands
0030             return (_Left + _Right);
0031         }
0032     };
0033     // helper to dereference a pointer to a function pointer
0034     template <class T>
0035     struct deref 
0036     {
0037         typedef T& result_type;
0038         T& operator()(T*  f) const
0039         {
0040             return *f;
0041         }
0042     };
0043 } } }//boost::msm::back
0044 #endif //BOOST_MSM_BACK_BIND_HELPERS_H