Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:09:32

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Hartmut Kaiser
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(BOOST_SPIRIT_HANDLES_CONTAINER_DEC_18_2010_0920AM)
0008 #define BOOST_SPIRIT_HANDLES_CONTAINER_DEC_18_2010_0920AM
0009 
0010 #if defined(_MSC_VER)
0011 #pragma once
0012 #endif
0013 
0014 #include <boost/spirit/home/support/attributes_fwd.hpp>
0015 #include <boost/mpl/bool.hpp>
0016 #include <boost/mpl/or.hpp>
0017 #include <boost/mpl/not.hpp>
0018 #include <boost/mpl/find_if.hpp>
0019 #include <boost/type_traits/is_same.hpp>
0020 
0021 namespace boost { namespace spirit { namespace traits
0022 {
0023     // Finds out whether a component handles container attributes intrinsically
0024     // (or whether container attributes need to be split up separately).
0025     template <typename T, typename Attribute, typename Context
0026             , typename Iterator, typename Enable>
0027     struct handles_container : mpl::false_ {};
0028 
0029     template <typename Subject, typename Attribute, typename Context
0030             , typename Iterator>
0031     struct unary_handles_container
0032       : handles_container<Subject, Attribute, Context, Iterator> {};
0033 
0034     template <typename Left, typename Right, typename Attribute
0035             , typename Context, typename Iterator>
0036     struct binary_handles_container 
0037       : mpl::or_<
0038             handles_container<Left, Attribute, Context, Iterator>
0039           , handles_container<Right, Attribute, Context, Iterator> > 
0040     {};
0041 
0042     template <typename Elements, typename Attribute, typename Context
0043             , typename Iterator>
0044     struct nary_handles_container
0045       : mpl::not_<
0046             is_same<
0047                 typename mpl::find_if<
0048                     Elements, handles_container<mpl::_, Attribute
0049                                               , Context, Iterator> 
0050                 >::type
0051               , typename mpl::end<Elements>::type> > 
0052     {};
0053 }}}
0054 
0055 #endif