From 44fd2878bf826e492e3047a022e657d1361784ef Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Wed, 5 Nov 2003 15:48:24 +0000 Subject: [PATCH] multiset checkin [SVN r20683] --- include/boost/mpl/aux_/count_impl.hpp | 44 +++++++ include/boost/mpl/aux_/value_wknd.hpp | 2 +- include/boost/mpl/aux_/yes_no.hpp | 40 ++++-- include/boost/mpl/count.hpp | 37 +++--- include/boost/mpl/count_fwd.hpp | 29 +++++ .../boost/mpl/multiset/aux_/count_impl.hpp | 81 ++++++++++++ .../boost/mpl/multiset/aux_/insert_impl.hpp | 33 +++++ include/boost/mpl/multiset/aux_/item.hpp | 116 ++++++++++++++++++ include/boost/mpl/multiset/aux_/multiset0.hpp | 33 +++++ include/boost/mpl/multiset/aux_/tag.hpp | 22 ++++ include/boost/mpl/multiset/multiset0.hpp | 35 ++++++ test/Jamfile | 1 + test/multiset.cpp | 43 +++++++ 13 files changed, 484 insertions(+), 32 deletions(-) create mode 100644 include/boost/mpl/aux_/count_impl.hpp create mode 100644 include/boost/mpl/count_fwd.hpp create mode 100644 include/boost/mpl/multiset/aux_/count_impl.hpp create mode 100644 include/boost/mpl/multiset/aux_/insert_impl.hpp create mode 100644 include/boost/mpl/multiset/aux_/item.hpp create mode 100644 include/boost/mpl/multiset/aux_/multiset0.hpp create mode 100644 include/boost/mpl/multiset/aux_/tag.hpp create mode 100644 include/boost/mpl/multiset/multiset0.hpp create mode 100644 test/multiset.cpp diff --git a/include/boost/mpl/aux_/count_impl.hpp b/include/boost/mpl/aux_/count_impl.hpp new file mode 100644 index 0000000..36fcdc3 --- /dev/null +++ b/include/boost/mpl/aux_/count_impl.hpp @@ -0,0 +1,44 @@ + +#ifndef BOOST_MPL_AUX_COUNT_IMPL_HPP_INCLUDED +#define BOOST_MPL_AUX_COUNT_IMPL_HPP_INCLUDED + +// + file: boost/mpl/aux_/count_impl.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2000-03 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/count_fwd.hpp" +#include "boost/mpl/count_if.hpp" +#include "boost/mpl/same_as.hpp" +#include "boost/mpl/aux_/config/static_constant.hpp" +#include "boost/mpl/aux_/config/workaround.hpp" +#include "boost/mpl/aux_/traits_lambda_spec.hpp" + +namespace boost { +namespace mpl { + +template< typename Tag > struct count_impl +{ + template< typename Sequence, typename T > struct apply +#if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x561)) + { + typedef typename count_if< Sequence,same_as >::type type; + BOOST_STATIC_CONSTANT(int, value = BOOST_MPL_AUX_VALUE_WKND(type)::value); +#else + : count_if< Sequence,same_as > + { +#endif + }; +}; + +BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,count_impl) + +}} + +#endif // BOOST_MPL_AUX_COUNT_IMPL_HPP_INCLUDED diff --git a/include/boost/mpl/aux_/value_wknd.hpp b/include/boost/mpl/aux_/value_wknd.hpp index f0676d9..06304ed 100644 --- a/include/boost/mpl/aux_/value_wknd.hpp +++ b/include/boost/mpl/aux_/value_wknd.hpp @@ -35,7 +35,7 @@ struct value_wknd #if defined(BOOST_MPL_MSVC_60_ETI_BUG) template<> struct value_wknd - : int_<0> + : int_<1> { }; #endif diff --git a/include/boost/mpl/aux_/yes_no.hpp b/include/boost/mpl/aux_/yes_no.hpp index 59395a7..b9a1bce 100644 --- a/include/boost/mpl/aux_/yes_no.hpp +++ b/include/boost/mpl/aux_/yes_no.hpp @@ -3,21 +3,20 @@ #define BOOST_MPL_AUX_YES_NO_HPP_INCLUDED // + file: boost/mpl/aux_/yes_no.hpp -// + last modified: 05/may/03 +// + last modified: 05/nov/03 -// Copyright (c) 2000-03 -// Aleksey Gurtovoy +// Copyright Aleksey Gurtovoy 2000-03 // -// Permission to use, copy, modify, distribute and sell this software -// and its documentation for any purpose is hereby granted without fee, -// provided that the above copyright notice appears in all copies and -// that both the copyright notice and this permission notice appear in -// supporting documentation. No representations are made about the -// suitability of this software for any purpose. It is provided "as is" -// without express or implied warranty. +// Use, modification and distribution are subject to 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) // // See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/aux_/config/workaround.hpp" +#include "boost/mpl/aux_/config/msvc.hpp" + namespace boost { namespace mpl { namespace aux { typedef char (&no_tag)[1]; @@ -33,6 +32,25 @@ template<> struct yes_no_tag typedef yes_tag type; }; -}}} + +template< long n > struct weighted_tag +{ +#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) + typedef char (&type)[n]; +#else + char buf[n]; + typedef weighted_tag type; +#endif +}; + +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ + || BOOST_WORKAROUND(BOOST_MSVC, == 1300) +template<> struct weighted_tag<0> +{ + typedef char (&type)[1]; +}; +#endif + +}}} // namespace boost::mpl::aux #endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED diff --git a/include/boost/mpl/count.hpp b/include/boost/mpl/count.hpp index 6bdedc8..0f675b7 100644 --- a/include/boost/mpl/count.hpp +++ b/include/boost/mpl/count.hpp @@ -1,24 +1,21 @@ -//----------------------------------------------------------------------------- -// boost mpl/count.hpp header file -// See http://www.boost.org for updates, documentation, and revision history. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2000-02 -// Aleksey Gurtovoy -// -// Permission to use, copy, modify, distribute and sell this software -// and its documentation for any purpose is hereby granted without fee, -// provided that the above copyright notice appears in all copies and -// that both the copyright notice and this permission notice appear in -// supporting documentation. No representations are made about the -// suitability of this software for any purpose. It is provided "as is" -// without express or implied warranty. #ifndef BOOST_MPL_COUNT_HPP_INCLUDED #define BOOST_MPL_COUNT_HPP_INCLUDED -#include "boost/mpl/count_if.hpp" -#include "boost/mpl/same_as.hpp" +// + file: boost/mpl/count.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2000-03 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/count_fwd.hpp" +#include "boost/mpl/aux_/count_impl.hpp" +#include "boost/mpl/aux_/sequence_tag.hpp" #include "boost/mpl/aux_/void_spec.hpp" #include "boost/mpl/aux_/lambda_support.hpp" @@ -32,7 +29,8 @@ template< , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T) > struct count - : count_if< Sequence,same_as > + : count_impl< typename BOOST_MPL_AUX_SEQUENCE_TAG(Sequence) > + ::template apply { BOOST_MPL_AUX_LAMBDA_SUPPORT(2,count,(Sequence,T)) }; @@ -41,7 +39,6 @@ BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END BOOST_MPL_AUX_ALGORITHM_VOID_SPEC(2, count) -} // namespace mpl -} // namespace boost +}} #endif // BOOST_MPL_COUNT_HPP_INCLUDED diff --git a/include/boost/mpl/count_fwd.hpp b/include/boost/mpl/count_fwd.hpp new file mode 100644 index 0000000..1d1d8c2 --- /dev/null +++ b/include/boost/mpl/count_fwd.hpp @@ -0,0 +1,29 @@ + +#ifndef BOOST_MPL_COUNT_FWD_HPP_INCLUDED +#define BOOST_MPL_COUNT_FWD_HPP_INCLUDED + +// + file: boost/mpl/count_fwd.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2000-03 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/aux_/algorithm_namespace.hpp" + +namespace boost { +namespace mpl { + +template< typename Tag > struct count_impl; + +BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN +template< typename Sequence, typename T > struct count; +BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END + +}} + +#endif // BOOST_MPL_COUNT_FWD_HPP_INCLUDED diff --git a/include/boost/mpl/multiset/aux_/count_impl.hpp b/include/boost/mpl/multiset/aux_/count_impl.hpp new file mode 100644 index 0000000..6be6a6e --- /dev/null +++ b/include/boost/mpl/multiset/aux_/count_impl.hpp @@ -0,0 +1,81 @@ + +#ifndef BOOST_MPL_MULTISET_AUX_COUNT_IMPL_HPP_INCLUDED +#define BOOST_MPL_MULTISET_AUX_COUNT_IMPL_HPP_INCLUDED + +// + file: boost/mpl/multiset/aux_/count_impl.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/multiset/aux_/tag.hpp" +#include "boost/mpl/count_fwd.hpp" +#include "boost/mpl/int.hpp" +#include "boost/mpl/aux_/type_wrapper.hpp" +#include "boost/mpl/aux_/static_cast.hpp" +#include "boost/mpl/aux_/config/static_constant.hpp" +#include "boost/mpl/aux_/config/workaround.hpp" +#include "boost/mpl/aux_/config/msvc.hpp" + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +# include "boost/mpl/if.hpp" +# include "boost/type_traits/is_reference.hpp" +#endif + +namespace boost { namespace mpl { + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +namespace aux { +template< typename S, typename U > +struct multiset_count_impl + : int_< sizeof(S::key_count(BOOST_MPL_AUX_STATIC_CAST(U*,0))) - 1 > +{ +}; + +template< typename S, typename U > +struct multiset_count_ref_impl +{ + typedef U (* u_)(); + typedef int_< sizeof(S::ref_key_count(BOOST_MPL_AUX_STATIC_CAST(u_,0))) - 1 > type_; + BOOST_STATIC_CONSTANT(int, value = type_::value); + typedef type_ type; +}; +} + +template<> +struct count_impl< aux::multiset_tag > +{ + template< typename Set, typename Key > struct apply + : if_< + is_reference + , aux::multiset_count_ref_impl + , aux::multiset_count_impl + >::type + { + }; +}; + +#else + +template<> +struct count_impl< aux::multiset_tag > +{ + template< typename Set, typename Key > struct apply + { + enum { msvc71_wknd_ = sizeof(Set::key_count(BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper*,0))) - 1 }; + typedef int_< msvc71_wknd_ > type; + BOOST_STATIC_CONSTANT(int, value = msvc71_wknd_); + }; +}; + +#endif // BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +}} // namespace boost::mpl + +#endif // BOOST_MPL_MULTISET_AUX_COUNT_IMPL_HPP_INCLUDED diff --git a/include/boost/mpl/multiset/aux_/insert_impl.hpp b/include/boost/mpl/multiset/aux_/insert_impl.hpp new file mode 100644 index 0000000..4e75437 --- /dev/null +++ b/include/boost/mpl/multiset/aux_/insert_impl.hpp @@ -0,0 +1,33 @@ + +#ifndef BOOST_MPL_MULTISET_AUX_INSERT_IMPL_HPP_INCLUDED +#define BOOST_MPL_MULTISET_AUX_INSERT_IMPL_HPP_INCLUDED + +// + file: boost/mpl/multiset/aux_/insert_impl.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/multiset/aux_/item.hpp" +#include "boost/mpl/multiset/aux_/tag.hpp" +#include "boost/mpl/insert_fwd.hpp" + +namespace boost { namespace mpl { +//#error here! +template<> +struct insert_traits< aux::multiset_tag > +{ + template< typename Set, typename Key, typename unused_ > struct algorithm + { + typedef ms_item type; + }; +}; + +}} // namespace boost::mpl + +#endif // BOOST_MPL_MULTISET_AUX_INSERT_IMPL_HPP_INCLUDED diff --git a/include/boost/mpl/multiset/aux_/item.hpp b/include/boost/mpl/multiset/aux_/item.hpp new file mode 100644 index 0000000..348d9da --- /dev/null +++ b/include/boost/mpl/multiset/aux_/item.hpp @@ -0,0 +1,116 @@ + +#ifndef BOOST_MPL_MULTISET_AUX_ITEM_HPP_INCLUDED +#define BOOST_MPL_MULTISET_AUX_ITEM_HPP_INCLUDED + +// + file: boost/mpl/multiset/aux_/item.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/multiset/aux_/tag.hpp" +#include "boost/mpl/int.hpp" +#include "boost/mpl/aux_/type_wrapper.hpp" +#include "boost/mpl/aux_/yes_no.hpp" +#include "boost/mpl/aux_/value_wknd.hpp" +#include "boost/mpl/aux_/static_cast.hpp" +#include "boost/mpl/aux_/config/workaround.hpp" +#include "boost/mpl/aux_/config/msvc.hpp" + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +# include "boost/mpl/apply_if.hpp" +# include "boost/mpl/next.hpp" +# include "boost/type_traits/is_same.hpp" +#endif + +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ + || BOOST_WORKAROUND(BOOST_MSVC, == 1300) +# define BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES +#endif + +namespace boost { namespace mpl { + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +template< typename T, typename Base > +struct ms_item +{ + typedef aux::multiset_tag tag; + + template< typename U > struct prior_count + { + enum { msvc70_wknd_ = sizeof(Base::key_count(BOOST_MPL_AUX_STATIC_CAST(U*,0))) }; + typedef int_< msvc70_wknd_ > count_; + typedef typename apply_if< is_same, next, count_ >::type c_; +#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) + typedef typename aux::weighted_tag::type type; +#else + typedef char (&type)[BOOST_MPL_AUX_MSVC_VALUE_WKND(c_)::value]; +#endif + }; + + template< typename U > struct prior_ref_count + { + typedef U (* u_)(); + enum { msvc70_wknd_ = sizeof(Base::ref_key_count(BOOST_MPL_AUX_STATIC_CAST(u_,0))) }; + typedef int_< msvc70_wknd_ > count_; + typedef typename apply_if< is_same, next, count_ >::type c_; +#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) + typedef typename aux::weighted_tag::type type; +#else + typedef char (&type)[BOOST_MPL_AUX_MSVC_VALUE_WKND(c_)::value]; +#endif + }; + + template< typename U > + static typename prior_count::type key_count(U*); + + template< typename U > + static typename prior_ref_count::type ref_key_count(U (*)()); +}; + +#else // BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +namespace aux { +template< typename U, typename Base > +struct prior_key_count +{ + enum { msvc71_wknd_ = sizeof(Base::key_count(BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper*,0))) }; + typedef int_< msvc71_wknd_ > count_; +#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) + typedef typename aux::weighted_tag< BOOST_MPL_AUX_VALUE_WKND(count_)::value >::type type; +#else + typedef char (&type)[count_::value]; +#endif +}; +} + +template< typename T, typename Base > +struct ms_item +{ + typedef aux::multiset_tag tag; + + enum { msvc71_wknd_ = sizeof(Base::key_count(BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper*,0))) + 1 }; + typedef int_< msvc71_wknd_ > count_; +#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) + static + typename aux::weighted_tag< BOOST_MPL_AUX_VALUE_WKND(count_)::value >::type + key_count(aux::type_wrapper*); +#else + static char (& key_count(aux::type_wrapper*) )[count_::value]; +#endif + + template< typename U > + static typename aux::prior_key_count::type key_count(aux::type_wrapper*); +}; + +#endif // BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +}} // namespace boost::mpl + +#endif // BOOST_MPL_MULTISET_AUX_ITEM_HPP_INCLUDED diff --git a/include/boost/mpl/multiset/aux_/multiset0.hpp b/include/boost/mpl/multiset/aux_/multiset0.hpp new file mode 100644 index 0000000..f34acf5 --- /dev/null +++ b/include/boost/mpl/multiset/aux_/multiset0.hpp @@ -0,0 +1,33 @@ + +#ifndef BOOST_MPL_MULTISET_AUX_MULTISET0_HPP_INCLUDED +#define BOOST_MPL_MULTISET_AUX_MULTISET0_HPP_INCLUDED + +// + file: boost/mpl/multiset/aux_/multiset0.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/multiset/aux_/tag.hpp" +#include "boost/mpl/int.hpp" + +namespace boost { namespace mpl { + +template< int dummy_ = 0 > +struct multiset0 +{ + typedef aux::multiset_tag tag; + + typedef int_<1> count_; + static char (& key_count(...) )[count_::value]; + static char (& ref_key_count(...) )[count_::value]; +}; + +}} // namespace boost::mpl + +#endif // BOOST_MPL_MULTISET_AUX_MULTISET0_HPP_INCLUDED diff --git a/include/boost/mpl/multiset/aux_/tag.hpp b/include/boost/mpl/multiset/aux_/tag.hpp new file mode 100644 index 0000000..73e6d12 --- /dev/null +++ b/include/boost/mpl/multiset/aux_/tag.hpp @@ -0,0 +1,22 @@ + +#ifndef BOOST_MPL_MULTISET_AUX_TAG_HPP_INCLUDED +#define BOOST_MPL_MULTISET_AUX_TAG_HPP_INCLUDED + +// + file: boost/mpl/multiset/aux_/tag.hpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +namespace boost { namespace mpl { namespace aux { + +struct multiset_tag; + +}}} + +#endif // BOOST_MPL_MULTISET_AUX_TAG_HPP_INCLUDED diff --git a/include/boost/mpl/multiset/multiset0.hpp b/include/boost/mpl/multiset/multiset0.hpp new file mode 100644 index 0000000..a543931 --- /dev/null +++ b/include/boost/mpl/multiset/multiset0.hpp @@ -0,0 +1,35 @@ + +#ifndef BOOST_MPL_MULTISET_MULTISET0_HPP_INCLUDED +#define BOOST_MPL_MULTISET_MULTISET0_HPP_INCLUDED + +// + file: boost/mpl/multiset0.hpp +// + last modified: 27/oct/03 + +// Copyright (C) Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +//#include "boost/mpl/multiset/aux_/at.hpp" +//#include "boost/mpl/multiset/aux_/front.hpp" +//#include "boost/mpl/multiset/aux_/push_front.hpp" +//#include "boost/mpl/multiset/aux_/pop_front.hpp" +//#include "boost/mpl/multiset/aux_/back.hpp" +//#include "boost/mpl/multiset/aux_/clear.hpp" +//#include "boost/mpl/multiset/aux_/O1_size.hpp" +//#include "boost/mpl/multiset/aux_/size.hpp" +//#include "boost/mpl/multiset/aux_/empty.hpp" +//#include "boost/mpl/multiset/aux_/empty.hpp" +#include "boost/mpl/multiset/aux_/insert_impl.hpp" +#include "boost/mpl/multiset/aux_/count_impl.hpp" +//#include "boost/mpl/multiset/aux_/has_key_impl.hpp" +//#include "boost/mpl/multiset/aux_/begin_end_impl.hpp" +//#include "boost/mpl/multiset/aux_/iterator.hpp" +#include "boost/mpl/multiset/aux_/item.hpp" +#include "boost/mpl/multiset/aux_/multiset0.hpp" +#include "boost/mpl/multiset/aux_/tag.hpp" + +#endif // BOOST_MPL_MULTISET_MULTISET0_HPP_INCLUDED diff --git a/test/Jamfile b/test/Jamfile index 9766c0d..eb60b03 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -48,6 +48,7 @@ compile joint_view.cpp ; compile lambda.cpp ; compile lambda_args.cpp ; compile max_element.cpp ; +compile multiset.cpp ; compile list.cpp ; compile list_c.cpp ; compile logical.cpp ; diff --git a/test/multiset.cpp b/test/multiset.cpp new file mode 100644 index 0000000..1870b4d --- /dev/null +++ b/test/multiset.cpp @@ -0,0 +1,43 @@ + +// + file: libs/mpl/test/multiset.cpp +// + last modified: 05/nov/03 + +// Copyright Aleksey Gurtovoy 2003 +// +// Use, modification and distribution are subject to 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/multiset/multiset0.hpp" +#include "boost/mpl/insert.hpp" +#include "boost/mpl/count.hpp" +#include "boost/static_assert.hpp" + +using namespace boost; +using namespace boost::mpl; + +struct abstract +{ + virtual ~abstract() = 0; +}; + +int main() +{ + typedef multiset0<> s0; + typedef insert::type s1; + typedef insert::type s2; + typedef insert::type s3; + typedef insert::type s4; + + BOOST_STATIC_ASSERT((count::value == 0)); + BOOST_STATIC_ASSERT((count::value == 1)); + BOOST_STATIC_ASSERT((count::value == 1)); + BOOST_STATIC_ASSERT((count::value == 1)); + BOOST_STATIC_ASSERT((count::value == 2)); + BOOST_STATIC_ASSERT((count::value == 1)); + BOOST_STATIC_ASSERT((count::value == 1)); + + return 0; +}