Chris@16: Chris@16: #ifndef BOOST_MPL_MULTISET_AUX_COUNT_IMPL_HPP_INCLUDED Chris@16: #define BOOST_MPL_MULTISET_AUX_COUNT_IMPL_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: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: # include Chris@16: # include Chris@16: #endif Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) Chris@16: Chris@16: namespace aux { Chris@16: template< typename S, typename U > Chris@16: struct multiset_count_impl Chris@16: : int_< sizeof(S::key_count(BOOST_MPL_AUX_STATIC_CAST(U*,0))) - 1 > Chris@16: { Chris@16: }; Chris@16: Chris@16: template< typename S, typename U > Chris@16: struct multiset_count_ref_impl Chris@16: { Chris@16: typedef U (* u_)(); Chris@16: typedef int_< sizeof(S::ref_key_count(BOOST_MPL_AUX_STATIC_CAST(u_,0))) - 1 > type_; Chris@16: BOOST_STATIC_CONSTANT(int, value = type_::value); Chris@16: typedef type_ type; Chris@16: }; Chris@16: } Chris@16: Chris@16: template<> Chris@16: struct count_impl< aux::multiset_tag > Chris@16: { Chris@16: template< typename Set, typename Key > struct apply Chris@16: : if_< Chris@16: is_reference Chris@16: , aux::multiset_count_ref_impl Chris@16: , aux::multiset_count_impl Chris@16: >::type Chris@16: { Chris@16: }; Chris@16: }; Chris@16: Chris@16: #else Chris@16: Chris@16: template<> Chris@16: struct count_impl< aux::multiset_tag > Chris@16: { Chris@16: template< typename Set, typename Key > struct apply Chris@16: { Chris@16: enum { msvc71_wknd_ = sizeof(Set::key_count(BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper*,0))) - 1 }; Chris@16: typedef int_< msvc71_wknd_ > type; Chris@16: BOOST_STATIC_CONSTANT(int, value = msvc71_wknd_); Chris@16: }; 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_COUNT_IMPL_HPP_INCLUDED