/*============================================================================= Copyright (c) 2001-2006 Joel de Guzman 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) ==============================================================================*/ #ifndef BOOST_PP_IS_ITERATING #if !defined(FUSION_SET_LOOKUP_09162005_1116) #define FUSION_SET_LOOKUP_09162005_1116 #include #include #include #include #include #if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) #pragma warning (push) #pragma warning(disable: 4348) // redefinition of default parameter #endif template struct meta_at_impl { typedef void_ type; }; template struct meta_find_impl { typedef vector_iterator type; }; template struct meta_find_impl_const { typedef vector_iterator type; }; template vector_iterator find_impl(mpl::identity) const { return vector_iterator(data); } template vector_iterator find_impl(mpl::identity) { return vector_iterator(data); } #define BOOST_PP_FILENAME_1 \ #define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_DEC(FUSION_MAX_SET_SIZE)) #include BOOST_PP_ITERATE() #if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) #pragma warning (pop) #endif #endif #else // defined(BOOST_PP_IS_ITERATING) /////////////////////////////////////////////////////////////////////////////// // // Preprocessor vertical repetition code // /////////////////////////////////////////////////////////////////////////////// #define N BOOST_PP_ITERATION() template struct meta_at_impl< typename detail::set_key_type::type, dummy> { typedef typename detail::set_value_type::type type; }; typename detail::set_data_type::type at_impl(mpl::identity::type>) { return detail::set_lookup_key< N , typename detail::set_data_type::type , typename detail::set_key_type::type , storage_type>::call(data); } typename detail::set_const_data_type::type at_impl(mpl::identity::type>) const { return detail::set_lookup_key< N , typename detail::set_const_data_type::type , typename detail::set_key_type::type , storage_type const>::call(data); } template struct meta_find_impl< typename detail::set_key_type::type, dummy> { typedef vector_iterator type; }; template struct meta_find_impl_const< typename detail::set_key_type::type, dummy> { typedef vector_iterator type; }; vector_iterator find_impl(mpl::identity::type>) { return vector_iterator(data); } vector_iterator find_impl(mpl::identity::type>) const { return vector_iterator(data); } #undef N #endif // defined(BOOST_PP_IS_ITERATING)