]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/proto/test/noinvoke.cpp
1 ///////////////////////////////////////////////////////////////////////////////
4 // Copyright 2008 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/proto/core.hpp>
9 #include <boost/proto/transform/make.hpp>
10 #include <boost/type_traits/add_pointer.hpp>
11 #include <boost/type_traits/remove_pointer.hpp>
12 #include <boost/test/unit_test.hpp>
13 namespace proto
=boost::proto
;
20 // This remove_pointer invocation is bloked by noinvoke
21 boost::remove_pointer
<
22 // This add_pointer invocation is *not* blocked by noinvoke
32 // This add_pointer gets invoked because a substitution takes place
36 // This remove_pointer invocation is bloked by noinvoke
37 boost::remove_pointer
<
38 // This add_pointer invocation is *not* blocked by noinvoke
46 template<typename T
, typename U
>
55 // This add_pointer gets invoked because a substitution takes place
60 // This remove_pointer invocation is bloked by noinvoke
63 // This add_pointer invocation is *not* blocked by noinvoke
64 , boost::add_pointer
<_
>
74 typedef proto::terminal
<int>::type Int
;
79 boost::result_of
<Test(Int
)>::type
80 , boost::remove_pointer
<Int
*>
84 boost::remove_pointer
<Int
*> t
= Test()(i
);
88 boost::result_of
<Test2(Int
)>::type
89 , boost::remove_pointer
<Int
*> *
93 boost::remove_pointer
<Int
*> * t2
= Test2()(i
);
97 boost::result_of
<Test3(Int
)>::type
98 , select2nd
<void, Int
*>
102 select2nd
<void, Int
*> t3
= Test3()(i
);
105 using namespace boost::unit_test
;
106 ///////////////////////////////////////////////////////////////////////////////
107 // init_unit_test_suite
109 test_suite
* init_unit_test_suite( int argc
, char* argv
[] )
111 test_suite
*test
= BOOST_TEST_SUITE("test proto::noinvoke");
113 test
->add(BOOST_TEST_CASE(&test_noinvoke
));