1 | |
---|
2 | // Copyright Aleksey Gurtovoy 2004 |
---|
3 | // Copyright Alexander Nasonov 2004 |
---|
4 | // |
---|
5 | // Distributed under the Boost Software License, Version 1.0. |
---|
6 | // (See accompanying file LICENSE_1_0.txt or copy at |
---|
7 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
8 | // |
---|
9 | // See http://www.boost.org/libs/mpl for documentation. |
---|
10 | |
---|
11 | // $Source: /cvsroot/boost/boost/libs/mpl/test/empty_sequence.cpp,v $ |
---|
12 | // $Date: 2004/11/28 03:35:12 $ |
---|
13 | // $Revision: 1.2 $ |
---|
14 | |
---|
15 | #include <boost/mpl/empty_sequence.hpp> |
---|
16 | #include <boost/mpl/size.hpp> |
---|
17 | #include <boost/mpl/distance.hpp> |
---|
18 | #include <boost/mpl/advance.hpp> |
---|
19 | #include <boost/mpl/begin_end.hpp> |
---|
20 | #include <boost/mpl/aux_/test.hpp> |
---|
21 | |
---|
22 | #include <boost/type_traits/is_same.hpp> |
---|
23 | #include <boost/type_traits/add_pointer.hpp> |
---|
24 | |
---|
25 | MPL_TEST_CASE() |
---|
26 | { |
---|
27 | typedef begin<empty_sequence>::type begin; |
---|
28 | typedef end<empty_sequence>::type end; |
---|
29 | |
---|
30 | MPL_ASSERT(( is_same<begin,end> )); |
---|
31 | MPL_ASSERT_RELATION( (mpl::distance<begin,end>::value), ==, 0 ); |
---|
32 | MPL_ASSERT_RELATION( size<empty_sequence>::value, ==, 0 ); |
---|
33 | |
---|
34 | typedef advance_c<begin,0>::type advanced; |
---|
35 | MPL_ASSERT(( is_same<advanced,end> )); |
---|
36 | } |
---|