diff --git a/include/boost/mpl/vector/aux_/item.hpp b/include/boost/mpl/vector/aux_/item.hpp index cf01a02..d0449b8 100644 --- a/include/boost/mpl/vector/aux_/item.hpp +++ b/include/boost/mpl/vector/aux_/item.hpp @@ -37,6 +37,7 @@ struct v_item typedef typename next::type upper_bound_; typedef typename next::type size; typedef Base base; + typedef v_item type; // agurt 10/sep/04: MWCW <= 9.3 workaround here and below; the compiler // breaks if using declaration comes _before_ the new overload @@ -55,6 +56,7 @@ struct v_item typedef index_ lower_bound_; typedef typename next::type size; typedef Base base; + typedef v_item type; static aux::type_wrapper item_(index_); using Base::item_; @@ -72,6 +74,7 @@ struct v_mask typedef index_ upper_bound_; typedef typename prior::type size; typedef Base base; + typedef v_mask type; static aux::type_wrapper item_(index_); using Base::item_; @@ -87,6 +90,7 @@ struct v_mask typedef typename next::type lower_bound_; typedef typename prior::type size; typedef Base base; + typedef v_mask type; static aux::type_wrapper item_(index_); using Base::item_; diff --git a/test/vector.cpp b/test/vector.cpp index 61fe809..77b74b9 100644 --- a/test/vector.cpp +++ b/test/vector.cpp @@ -1,5 +1,5 @@ -// Copyright Aleksey Gurtovoy 2000-2004 +// Copyright Aleksey Gurtovoy 2000-2005 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -32,6 +33,11 @@ MPL_TEST_CASE() typedef vector2 v2; typedef vector9 v9; + MPL_ASSERT(( equal< v0,v0::type > )); + MPL_ASSERT(( equal< v1,v1::type > )); + MPL_ASSERT(( equal< v2,v2::type > )); + MPL_ASSERT(( equal< v9,v9::type > )); + MPL_ASSERT_RELATION( size::value, ==, 0 ); MPL_ASSERT_RELATION( size::value, ==, 1 ); MPL_ASSERT_RELATION( size::value, ==, 2 ); @@ -68,15 +74,35 @@ MPL_TEST_CASE() { typedef vector0<> v0; - typedef push_back::type v1; - MPL_ASSERT(( is_same< back::type,int > )); + typedef push_back::type v1; + typedef push_front::type v2; + typedef push_back::type v3; - typedef push_front::type v2; + MPL_ASSERT(( is_same< back::type,int > )); MPL_ASSERT(( is_same< back::type,int > )); MPL_ASSERT(( is_same< front::type,char > )); - - typedef push_back::type v3; MPL_ASSERT(( is_same< back::type,long > )); + + MPL_ASSERT(( equal< v1,v1::type > )); + MPL_ASSERT(( equal< v2,v2::type > )); + MPL_ASSERT(( equal< v3,v3::type > )); +} + +MPL_TEST_CASE() +{ + typedef vector9 v9; + + typedef pop_back::type v8; + typedef pop_front::type v7; + + MPL_ASSERT(( is_same< back::type,int > )); + MPL_ASSERT(( is_same< back::type,long > )); + MPL_ASSERT(( is_same< back::type,long > )); + MPL_ASSERT(( is_same< front::type,bool > )); + + MPL_ASSERT(( equal< v9,v9::type > )); + MPL_ASSERT(( equal< v8,v8::type > )); + MPL_ASSERT(( equal< v7,v7::type > )); } MPL_TEST_CASE() @@ -86,6 +112,11 @@ MPL_TEST_CASE() typedef vector v2; typedef vector v9; + MPL_ASSERT(( equal< v0,v0::type > )); + MPL_ASSERT(( equal< v1,v1::type > )); + MPL_ASSERT(( equal< v2,v2::type > )); + MPL_ASSERT(( equal< v9,v9::type > )); + MPL_ASSERT_RELATION( size::value, ==, 0 ); MPL_ASSERT_RELATION( size::value, ==, 1 ); MPL_ASSERT_RELATION( size::value, ==, 2 );