1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
9 #include <boost/noncopyable.hpp>
10 #include <boost/detail/lightweight_test.hpp>
11 #include <boost/phoenix/core.hpp>
12 #include <boost/phoenix/bind.hpp>
16 struct x //: boost::noncopyable // test non-copyable (hold this by reference)
26 template <typename T, typename F>
30 using boost::phoenix::arg_names::arg1;
31 using boost::phoenix::bind;
35 bind(&T::m, f(x_))() = 122;
36 BOOST_TEST(x_.m == 122);
37 bind(&T::m, arg1)(f(x_)) = 123;
38 BOOST_TEST(x_.m == 123);
41 template <typename T, typename F>
45 using boost::phoenix::arg_names::arg1;
46 using boost::phoenix::bind;
51 BOOST_TEST(bind(&T::m, f(x_))() == 123);
52 BOOST_TEST(bind(&T::m, arg1)(f(x_)) == 123);
59 operator()(T& t) const
69 operator()(T const& t) const
79 operator()(T& t) const
85 struct add_const_pointer
89 operator()(T const& t) const
98 write_test<test::x>(add_pointer());
99 write_test<test::xx>(add_pointer());
101 read_test<test::x>(identity());
102 read_test<test::x>(constify());
103 read_test<test::x>(add_pointer());
104 read_test<test::x>(add_const_pointer());
105 read_test<test::xx>(identity());
106 read_test<test::xx>(constify());
107 read_test<test::xx>(add_pointer());
108 read_test<test::xx>(add_const_pointer());
110 return boost::report_errors();