|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49695 - trunk/libs/spirit/phoenix/test/bind
From: joel_at_[hidden]
Date: 2008-11-12 02:26:41
Author: djowel
Date: 2008-11-12 02:26:40 EST (Wed, 12 Nov 2008)
New Revision: 49695
URL: http://svn.boost.org/trac/boost/changeset/49695
Log:
added cref/ref/val tests from Steven
Text files modified:
trunk/libs/spirit/phoenix/test/bind/bind_member_variable_tests.cpp | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
Modified: trunk/libs/spirit/phoenix/test/bind/bind_member_variable_tests.cpp
==============================================================================
--- trunk/libs/spirit/phoenix/test/bind/bind_member_variable_tests.cpp (original)
+++ trunk/libs/spirit/phoenix/test/bind/bind_member_variable_tests.cpp 2008-11-12 02:26:40 EST (Wed, 12 Nov 2008)
@@ -1,7 +1,7 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <iostream>
@@ -23,15 +23,27 @@
{
int m;
};
+
+ struct xx {
+ int m;
+ };
}
int
main()
{
- test::x x_;
- bind(&test::x::m, x_)() = 123;
- bind(&test::x::m, arg1)(x_) = 123;
- BOOST_TEST(x_.m == 123);
+ {
+ test::x x_;
+ bind(&test::x::m, x_)() = 123;
+ bind(&test::x::m, arg1)(x_) = 123;
+ BOOST_TEST(x_.m == 123);
+ }
+ {
+ test::xx x_= {0};
+ bind(&test::xx::m, val(x_))(); // does not compile
+ bind(&test::xx::m, ref(x_))() = 1;
+ bind(&test::xx::m, cref(x_))();
+ }
return boost::report_errors();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk