/*============================================================================= Copyright (c) 2001-2014 Joel de Guzman Copyright (c) 2013 Agustín Bergé http://spirit.sourceforge.net/ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #if !defined(BOOST_SPIRIT_X3_SUBCONTEXT_APR_15_2013_0840AM) #define BOOST_SPIRIT_X3_SUBCONTEXT_APR_15_2013_0840AM #if defined(_MSC_VER) #pragma once #endif #include #include #include namespace boost { namespace spirit { namespace x3 { template struct subcontext; template <> struct subcontext<> { template subcontext(Context const& /*context*/) {} template struct get_result { typedef unused_type type; }; template unused_type get(ID_) const { return unused; } }; template struct subcontext : context { typedef context< typename T::first_type, typename T::second_type > context_type; template subcontext(Context const& context) : context_type(x3::get(context)) {} using context_type::get; }; template struct subcontext : subcontext , context< typename T::first_type, typename T::second_type , subcontext > { typedef subcontext base_type; typedef context< typename T::first_type, typename T::second_type , base_type > context_type; template subcontext(Context const& context) : base_type(context) , context_type( x3::get(context) , *static_cast(this)) {} using context_type::get; }; }}} #endif