Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: /// \file template_arity.hpp Chris@16: /// Replace all nodes stored by reference by nodes stored by value. Chris@16: // Chris@16: // Copyright 2011 Eric Niebler. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // This file is based on a similar one in MPL from Aleksey Gurtovoy. Chris@16: Chris@16: #ifndef BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07 Chris@16: #define BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07 Chris@16: Chris@16: // Somewhat indirect definition of BOOST_PROTO_TEMPLATE_ARITY_PARAM is Chris@16: // to overcome a shortcoming of the Wave tool used to generate the Chris@16: // pre-preprocessed headers. Chris@16: #define BOOST_PROTO_TEMPLATE_ARITY_PARAM BOOST_PROTO_TEMPLATE_ARITY_PARAM2 Chris@16: #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) Chris@16: Chris@16: #if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) || \ Chris@16: (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)) Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #undef BOOST_PROTO_TEMPLATE_ARITY_PARAM2 Chris@16: #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) , param Chris@16: Chris@16: namespace boost { namespace proto { namespace detail Chris@16: { Chris@16: sized_type<1>::type template_arity_helper(...); Chris@16: Chris@16: // Other overloads generated by the preprocessor Chris@16: #include Chris@16: Chris@16: template Chris@16: struct template_arity_impl2 Chris@16: : mpl::int_ Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct template_arity Chris@16: : template_arity_impl2< Chris@16: F Chris@16: , N Chris@16: , sizeof(detail::template_arity_helper((F **)0, (mpl::int_ *)0)) Chris@16: > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct template_arity_impl2 Chris@16: : template_arity Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct template_arity_impl2 Chris@16: : mpl::int_<-1> Chris@16: {}; Chris@16: Chris@16: }}} Chris@16: Chris@16: #endif // BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING Chris@16: #endif // BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07