]> git.sesse.net Git - casparcg/blob - dependencies/boost/boost/phoenix/bind/bind_member_variable.hpp
Manually merged pull request #222
[casparcg] / dependencies / boost / boost / phoenix / bind / bind_member_variable.hpp
1 /*=============================================================================
2     Copyright (c) 2001-2007 Joel de Guzman
3
4     Distributed under the Boost Software License, Version 1.0. (See accompanying 
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7
8 #ifndef PHOENIX_BIND_BIND_MEMBER_VARIABLE_HPP
9 #define PHOENIX_BIND_BIND_MEMBER_VARIABLE_HPP
10
11 #include <boost/phoenix/core/expression.hpp>
12 #include <boost/phoenix/core/detail/function_eval.hpp>
13 #include <boost/phoenix/bind/detail/member_variable.hpp>
14
15 namespace boost { namespace phoenix
16 {
17     template <typename RT, typename ClassT, typename ClassA>
18     inline typename
19         detail::expression::function_eval<
20             detail::member_variable<RT, RT ClassT::*>
21           , ClassA
22         >::type const
23     bind(RT ClassT::*mp, ClassA const& obj)
24     {
25         typedef detail::member_variable<RT, RT ClassT::*> mp_type;
26         return
27             detail::expression::function_eval<mp_type, ClassA>
28                 ::make(mp_type(mp), obj);
29     }
30
31     template <typename RT, typename ClassT>
32     inline typename
33         detail::expression::function_eval<
34             detail::member_variable<RT, RT ClassT::*>
35           , ClassT
36         >::type const
37     bind(RT ClassT::*mp, ClassT& obj)
38     {
39         typedef detail::member_variable<RT, RT ClassT::*> mp_type;
40         return
41             detail::expression::function_eval<
42                 mp_type
43               , ClassT
44             >::make(mp_type(mp), obj);
45     }
46
47 }}
48
49 #endif