// Copyright Aleksey Gurtovoy 2003-2004 // Copyright David Abrahams 2003-2004 // // 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) // // See http://www.boost.org/libs/mpl for documentation. // $Source$ // $Date$ // $Revision$ #include #include #include #include #include #include #include #include #include #include #include #include MPL_TEST_CASE() { typedef s_mask > > > s; MPL_ASSERT_RELATION( size::value, ==, 1 ); MPL_ASSERT_NOT(( empty )); MPL_ASSERT(( is_same< clear::type, set0<> > )); MPL_ASSERT(( is_same< at::type, int > )); MPL_ASSERT(( is_same< at::type, void_ > )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT_RELATION( (order::value), ==, 3 ); MPL_ASSERT(( is_same< order::type, void_ > )); typedef begin::type first; typedef end::type last; MPL_ASSERT(( is_same< deref::type, int > )); MPL_ASSERT(( is_same< next::type, last > )); typedef s_unmask s2; MPL_ASSERT_RELATION( size::value, ==, 2 ); MPL_ASSERT_NOT(( empty )); MPL_ASSERT(( is_same::type, set0<> > )); MPL_ASSERT(( is_same::type, int > )); MPL_ASSERT(( is_same::type, char > )); MPL_ASSERT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_RELATION( (order::value), ==, 3 ); MPL_ASSERT_RELATION( (order::value), ==, 2 ); typedef begin::type first2; typedef end::type last2; MPL_ASSERT(( is_same< first2::type, int > )); typedef next::type iter; MPL_ASSERT(( is_same< iter::type, char > )); MPL_ASSERT(( is_same< next::type, last2 > )); typedef insert::type s2_1; MPL_ASSERT(( is_same )); typedef insert::type s3; MPL_ASSERT_RELATION( size::value, ==, 3 ); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); typedef insert::type s1; MPL_ASSERT_RELATION( size::value, ==, 2 ); MPL_ASSERT(( is_same::type, int > )); MPL_ASSERT(( is_same::type, char > )); MPL_ASSERT_NOT(( is_same )); typedef erase_key::type s_1; MPL_ASSERT(( is_same )); MPL_ASSERT_RELATION( size::value, ==, 1 ); MPL_ASSERT(( is_same< at::type, void_ > )); MPL_ASSERT(( is_same< at::type, int > )); } MPL_TEST_CASE() { typedef set0<> s; MPL_ASSERT_RELATION( size::value, ==, 0 ); MPL_ASSERT(( empty )); MPL_ASSERT(( is_same< clear::type, set0<> > )); MPL_ASSERT(( is_same< at::type, void_ > )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); typedef insert::type s1; MPL_ASSERT_RELATION( size::value, ==, 1 ); MPL_ASSERT(( is_same< at::type, char > )); typedef erase_key::type s0_1; MPL_ASSERT_RELATION( size::value, ==, 0 ); MPL_ASSERT(( is_same< at::type, void_ > )); } MPL_TEST_CASE() { typedef set< char,int const,long*,UDT* const,incomplete,abstract , incomplete volatile&,abstract const& > s; MPL_ASSERT_RELATION( size::value, ==, 8 ); MPL_ASSERT_NOT(( empty )); MPL_ASSERT(( is_same< clear::type, set0<> > )); MPL_ASSERT(( is_same< at::type, void_ > )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); MPL_ASSERT_NOT(( has_key )); }