1 /*==============================================================================
2 Copyright (c) 2005-2008 Hartmut Kaiser
3 Copyright (c) 2005-2010 Joel de Guzman
4 Copyright (c) 2010 Thomas Heller
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9 #ifndef BOOST_PHOENIX_FUSION_AT_HPP
10 #define BOOST_PHOENIX_FUSION_AT_HPP
12 #include <boost/phoenix/core/limits.hpp>
13 #include <boost/fusion/sequence/intrinsic/at_c.hpp>
14 #include <boost/phoenix/core/expression.hpp>
15 #include <boost/phoenix/core/meta_grammar.hpp>
16 #include <boost/type_traits/remove_reference.hpp>
18 BOOST_PHOENIX_DEFINE_EXPRESSION(
19 (boost)(phoenix)(at_c)
20 , (proto::terminal<proto::_>)
24 namespace boost { namespace phoenix
26 template <typename Dummy>
27 struct default_actions::when<rule::at_c, Dummy>
29 proto::functional::at(
30 evaluator(proto::_child_c<1>)
31 , proto::_value(proto::_child_c<0>)
36 template <int N, typename Tuple>
38 typename expression::at_c<mpl::int_<N>, Tuple>::type const
39 at_c(Tuple const& tuple)
43 at_c<mpl::int_<N>, Tuple>::
44 make(mpl::int_<N>(), tuple);