Chris@16: Chris@16: #ifndef BOOST_MPL_MULTISET_AUX_ITEM_HPP_INCLUDED Chris@16: #define BOOST_MPL_MULTISET_AUX_ITEM_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2003-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: #endif Chris@16: Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: Chris@16: template< typename T, typename Base > Chris@16: struct ms_item Chris@16: { Chris@16: typedef aux::multiset_tag tag; Chris@16: Chris@16: template< typename U > struct prior_count Chris@16: { Chris@16: enum { msvc70_wknd_ = sizeof(Base::key_count(BOOST_MPL_AUX_STATIC_CAST(U*,0))) }; Chris@16: typedef int_< msvc70_wknd_ > count_; Chris@16: typedef typename eval_if< is_same, next, count_ >::type c_; Chris@16: #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) Chris@16: typedef typename aux::weighted_tag::type type; Chris@16: #else Chris@16: typedef char (&type)[BOOST_MPL_AUX_MSVC_VALUE_WKND(c_)::value]; Chris@16: #endif Chris@16: }; Chris@16: Chris@16: template< typename U > struct prior_ref_count Chris@16: { Chris@16: typedef U (* u_)(); Chris@16: enum { msvc70_wknd_ = sizeof(Base::ref_key_count(BOOST_MPL_AUX_STATIC_CAST(u_,0))) }; Chris@16: typedef int_< msvc70_wknd_ > count_; Chris@16: typedef typename eval_if< is_same, next, count_ >::type c_; Chris@16: #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) Chris@16: typedef typename aux::weighted_tag::type type; Chris@16: #else Chris@16: typedef char (&type)[BOOST_MPL_AUX_MSVC_VALUE_WKND(c_)::value]; Chris@16: #endif Chris@16: }; Chris@16: Chris@16: template< typename U > Chris@16: static typename prior_count::type key_count(U*); Chris@16: Chris@16: template< typename U > Chris@16: static typename prior_ref_count::type ref_key_count(U (*)()); Chris@16: }; Chris@16: Chris@16: #else // BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: Chris@16: namespace aux { Chris@16: template< typename U, typename Base > Chris@16: struct prior_key_count Chris@16: { Chris@16: enum { msvc71_wknd_ = sizeof(Base::key_count(BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper*,0))) }; Chris@16: typedef int_< msvc71_wknd_ > count_; Chris@16: #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) Chris@16: typedef typename aux::weighted_tag< BOOST_MPL_AUX_VALUE_WKND(count_)::value >::type type; Chris@16: #else Chris@16: typedef char (&type)[count_::value]; Chris@16: #endif Chris@16: }; Chris@16: } Chris@16: Chris@16: template< typename T, typename Base > Chris@16: struct ms_item Chris@16: { Chris@16: typedef aux::multiset_tag tag; Chris@16: Chris@16: enum { msvc71_wknd_ = sizeof(Base::key_count(BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper*,0))) + 1 }; Chris@16: typedef int_< msvc71_wknd_ > count_; Chris@16: #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) Chris@16: static Chris@16: typename aux::weighted_tag< BOOST_MPL_AUX_VALUE_WKND(count_)::value >::type Chris@16: key_count(aux::type_wrapper*); Chris@16: #else Chris@16: static char (& key_count(aux::type_wrapper*) )[count_::value]; Chris@16: #endif Chris@16: Chris@16: template< typename U > Chris@16: static typename aux::prior_key_count::type key_count(aux::type_wrapper*); Chris@16: }; Chris@16: Chris@16: #endif // BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_MULTISET_AUX_ITEM_HPP_INCLUDED