Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/phoenix/bind/bind_member_variable.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*=============================================================================
0002     Copyright (c) 2001-2007 Joel de Guzman
0003     Copyright (c) 2014      John Fletcher
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 
0009 #ifndef PHOENIX_BIND_BIND_MEMBER_VARIABLE_HPP
0010 #define PHOENIX_BIND_BIND_MEMBER_VARIABLE_HPP
0011 
0012 #include <boost/utility/enable_if.hpp>
0013 #include <boost/type_traits/is_member_function_pointer.hpp>
0014 #include <boost/phoenix/core/expression.hpp>
0015 #include <boost/phoenix/core/detail/function_eval.hpp>
0016 #include <boost/phoenix/bind/detail/member_variable.hpp>
0017 
0018 namespace boost { namespace phoenix
0019 {
0020     template <typename RT, typename ClassT, typename ClassA>
0021     inline
0022     typename boost::lazy_disable_if<
0023       boost::is_member_function_pointer<RT (ClassT::*)>,
0024         typename detail::expression::function_eval<
0025             detail::member_variable<RT, RT ClassT::*>
0026           , ClassA >//::type
0027       >::type const
0028     bind(RT ClassT::*mp, ClassA const& obj)
0029     {
0030         typedef detail::member_variable<RT, RT ClassT::*> mp_type;
0031         return
0032             detail::expression::function_eval<mp_type, ClassA>
0033                 ::make(mp_type(mp), obj);
0034     }
0035 
0036     template <typename RT, typename ClassT>
0037     inline
0038     typename boost::lazy_disable_if<
0039       boost::is_member_function_pointer<RT (ClassT::*)>,
0040         typename detail::expression::function_eval<
0041             detail::member_variable<RT, RT ClassT::*>
0042           , ClassT >//::type
0043         >::type const
0044     bind(RT ClassT::*mp, ClassT& obj)
0045     {
0046         typedef detail::member_variable<RT, RT ClassT::*> mp_type;
0047         return
0048             detail::expression::function_eval<
0049                 mp_type
0050               , ClassT
0051             >::make(mp_type(mp), obj);
0052     }
0053 
0054 }}
0055 
0056 #endif