1 | |
---|
2 | // Copyright Aleksey Gurtovoy 2000-2004 |
---|
3 | // Copyright John R. Bandela 2000-2002 |
---|
4 | // Copyright David Abrahams 2003-2004 |
---|
5 | // |
---|
6 | // Distributed under the Boost Software License, Version 1.0. |
---|
7 | // (See accompanying file LICENSE_1_0.txt or copy at |
---|
8 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
9 | // |
---|
10 | // See http://www.boost.org/libs/mpl for documentation. |
---|
11 | |
---|
12 | // $Source: /cvsroot/boost/boost/libs/mpl/test/replace_if.cpp,v $ |
---|
13 | // $Date: 2004/09/02 15:41:35 $ |
---|
14 | // $Revision: 1.5 $ |
---|
15 | |
---|
16 | #include <boost/mpl/replace_if.hpp> |
---|
17 | |
---|
18 | #include <boost/mpl/list/list10_c.hpp> |
---|
19 | #include <boost/mpl/int.hpp> |
---|
20 | #include <boost/mpl/equal.hpp> |
---|
21 | #include <boost/mpl/greater.hpp> |
---|
22 | #include <boost/mpl/equal_to.hpp> |
---|
23 | |
---|
24 | #include <boost/mpl/aux_/test.hpp> |
---|
25 | |
---|
26 | MPL_TEST_CASE() |
---|
27 | { |
---|
28 | typedef list8_c<int,1,4,5,2,7,5,3,5>::type numbers; |
---|
29 | typedef replace_if< numbers, greater<_1,int_<4> >, int_<0> >::type result; |
---|
30 | |
---|
31 | typedef list8_c<int,1,4,0,2,0,0,3,0>::type answer; |
---|
32 | MPL_ASSERT(( equal< answer,result,equal_to<_1,_2> > )); |
---|
33 | } |
---|