comparison DEPENDENCIES/generic/include/boost/spirit/home/phoenix/object/reinterpret_cast.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
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 #ifndef PHOENIX_OBJECT_REINTERPRET_CAST_HPP
8 #define PHOENIX_OBJECT_REINTERPRET_CAST_HPP
9
10 #include <boost/spirit/home/phoenix/core/compose.hpp>
11
12 namespace boost { namespace phoenix
13 {
14 namespace impl
15 {
16 template <typename T>
17 struct reinterpret_cast_eval
18 {
19 template <typename Env, typename U>
20 struct result
21 {
22 typedef T type;
23 };
24
25 template <typename RT, typename Env, typename U>
26 static RT
27 eval(Env const& env, U& obj)
28 {
29 return reinterpret_cast<RT>(obj.eval(env));
30 }
31 };
32 }
33
34 template <typename T, typename U>
35 inline actor<typename as_composite<impl::reinterpret_cast_eval<T>, U>::type>
36 reinterpret_cast_(U const& obj)
37 {
38 return compose<impl::reinterpret_cast_eval<T> >(obj);
39 }
40 }}
41
42 #endif