]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/operator/self_tests.cpp
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 ==============================================================================*/
10 #include <boost/detail/lightweight_test.hpp>
11 #include <boost/phoenix/core.hpp>
12 #include <boost/phoenix/operator.hpp>
14 namespace phoenix
= boost::phoenix
;
20 using phoenix::arg_names::arg1
;
21 using phoenix::arg_names::arg2
;
28 BOOST_TEST((&arg1
)(x
) == &x
);
29 //BOOST_TEST((*&arg1)(x) == 123);
37 int& r
= (arg1
= 456)(x
); // must be an lvalue
40 int c
[] = { 1, 2, 3, 4, 5 };
41 BOOST_TEST((arg1
[3])(c
) == 4);
43 int& r2
= (arg1
[3])(c
); // must be an lvalue
44 BOOST_TEST(&r2
== &c
[3]);
52 BOOST_TEST((arg1
[3])(v
) == "d");
55 (arg1
["Kimpo"] = arg2
)(m
, x
);
56 BOOST_TEST(m
["Kimpo"] == x
);
59 return boost::report_errors();