]> git.sesse.net Git - casparcg/blob - dependencies/boost/boost/spirit/home/phoenix/core/detail/composite_info.hpp
Manually merged pull request #222
[casparcg] / dependencies / boost / boost / spirit / home / phoenix / core / detail / composite_info.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 #ifndef PHOENIX_CORE_DETAIL_COMPOSITE_INFO_HPP
8 #define PHOENIX_CORE_DETAIL_COMPOSITE_INFO_HPP
9
10 #include <boost/mpl/if.hpp>
11 #include <boost/mpl/greater.hpp>
12 #include <boost/mpl/int.hpp>
13 #include <boost/spirit/home/fusion/algorithm/fold.hpp>
14
15 namespace boost { namespace phoenix { namespace detail
16 {
17     struct max_nesting
18     {
19         template <typename T, typename State>
20         struct result :
21             mpl::if_<
22                 mpl::greater<typename T::nesting, State>
23               , typename T::nesting
24               , State
25             >
26         {};
27     };
28
29     template <typename ActorTuple>
30     struct compute_nesting
31     {
32         typedef typename
33             fusion::meta::fold<ActorTuple, mpl::int_<0>, max_nesting>::type
34         type;
35     };
36
37 }}}
38
39 #endif
40