|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64380 - in sandbox/SOC/2010/phoenix3: boost/phoenix boost/phoenix/core boost/phoenix/core/detail boost/phoenix/statement libs/phoenix/test libs/phoenix/test/boost_bind_compatibility libs/phoenix/test/scope
From: thom.heller_at_[hidden]
Date: 2010-07-27 06:05:36
Author: theller
Date: 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
New Revision: 64380
URL: http://svn.boost.org/trac/boost/changeset/64380
Log:
adapted boost.bind tests
Added:
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp (contents, props changed)
sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_visit_test.cpp (contents, props changed)
Text files modified:
sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp | 4 ++--
sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp | 4 +++-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp | 9 ++++++++-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_fun_eval.hpp | 2 +-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp | 4 ++--
sandbox/SOC/2010/phoenix3/boost/phoenix/core/no_nullary.hpp | 2 +-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp | 1 -
sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp | 3 +--
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp | 1 +
sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile | 28 ++++++++++++++++++++++++++++
sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/dynamic_tests.cpp | 2 +-
11 files changed, 48 insertions(+), 12 deletions(-)
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -16,7 +16,7 @@
#include <boost/phoenix/core/value.hpp>
#include <boost/phoenix/core/reference.hpp>
#include <boost/phoenix/core/nothing.hpp>
-#include <boost/phoenix/core/arity.hpp>
-//#include <boost/phoenix/core/extension.hpp>
+#include <boost/phoenix/core/function_equal.hpp>
+#include <boost/phoenix/core/visit_each.hpp>
#endif
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -48,7 +48,7 @@
template <typename Expr>
struct actor<Expr>
{
- static const int arity = result_of::arity<Expr>::type::value;
+ //static const int arity = result_of::arity<Expr>::type::value;
typedef typename
mpl::eval_if<
@@ -110,10 +110,12 @@
template <typename Sig>
struct result;
+ /*
template <typename This>
struct result<This()>
: result_of::actor<Expr>
{};
+ */
typename result_of::actor<Expr>::type
operator()() const
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -9,8 +9,9 @@
#ifndef PHOENIX_CORE_ARGUMENT_HPP
#define PHOENIX_CORE_ARGUMENT_HPP
-#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/compose.hpp>
+#include <boost/phoenix/core/actor.hpp>
+#include <boost/phoenix/core/no_nullary.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/environment.hpp>
@@ -80,6 +81,12 @@
make_argument<mpl::int_<0> >::type const _1 = {};
make_argument<mpl::int_<1> >::type const _2 = {};
make_argument<mpl::int_<2> >::type const _3 = {};
+ make_argument<mpl::int_<2> >::type const _4 = {};
+ make_argument<mpl::int_<2> >::type const _5 = {};
+ make_argument<mpl::int_<2> >::type const _6 = {};
+ make_argument<mpl::int_<2> >::type const _7 = {};
+ make_argument<mpl::int_<2> >::type const _8 = {};
+ make_argument<mpl::int_<2> >::type const _9 = {};
}
namespace arg_names
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_fun_eval.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_fun_eval.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_fun_eval.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -27,7 +27,7 @@
struct actor_fun_eval<PHOENIX_A>
{
#define EVAL_RESULTS(_, n, __) BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) typename boost::result_of<eval_grammar(A ## n const&, Env&)>::type
- template <typename Env>
+ template <typename Env, typename Dummy = void>
struct basic_environment
: make_basic_environment<
BOOST_PP_REPEAT_FROM_TO(
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -43,7 +43,7 @@
////////////////////////////////////////////////////////////////////////////
struct eval_cases
{
- template <class Tag>
+ template <typename Tag>
struct case_
: proto::or_<
proto::when<proto::terminal<env>, proto::_state>
@@ -55,7 +55,7 @@
////////////////////////////////////////////////////////////////////////////
// wrapper for a Fusion extension evaluator function. Keep this POD.
////////////////////////////////////////////////////////////////////////////
- template <class Fun>
+ template <typename Fun>
struct funcwrap
{
typedef Fun type;
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/no_nullary.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/no_nullary.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/no_nullary.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -23,7 +23,7 @@
namespace boost { namespace phoenix
{
- template <typename Fun>
+ template <typename F>
struct funcwrap;
template <typename Func, typename Dummy = void>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -8,7 +8,6 @@
#ifndef PHOENIX_CORE_REFERENCE_HPP
#define PHOENIX_CORE_REFERENCE_HPP
-#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/compose.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/utility/result_of.hpp>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -8,7 +8,6 @@
#ifndef PHOENIX_CORE_VALUE_HPP
#define PHOENIX_CORE_VALUE_HPP
-#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/compose.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/utility/result_of.hpp>
@@ -22,7 +21,7 @@
// function for evaluating values, e.g. val(123)
//
////////////////////////////////////////////////////////////////////////////
-
+
namespace result_of
{
template <typename Env, typename T>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -9,6 +9,7 @@
#define PHOENIX_STATEMENT_SWITCH_HPP
#include <boost/fusion/algorithm/transformation/push_front.hpp>
+#include <boost/fusion/container/vector/convert.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/phoenix/core/limits.hpp>
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -89,6 +89,34 @@
[ run algorithm/querying2.cpp ]
;
+test-suite phoenix_boost_bind_compatibility :
+ [ run boost_bind_compatibility/bind_and_or_test.cpp ]
+ [ run boost_bind_compatibility/bind_cdecl_mf_test.cpp ]
+ [ run boost_bind_compatibility/bind_const_test.cpp ]
+ [ run boost_bind_compatibility/bind_cv_test.cpp ] # problem: only const operator() overloads are regarded
+ [ run boost_bind_compatibility/bind_dm_test.cpp ]
+ [ run boost_bind_compatibility/bind_dm2_test.cpp ]
+ [ run boost_bind_compatibility/bind_dm3_test.cpp ]
+ [ run boost_bind_compatibility/bind_eq_test.cpp ] # problem: binary visitation of AST for equality test not implemented
+ [ run boost_bind_compatibility/bind_eq2_test.cpp ]
+ [ run boost_bind_compatibility/bind_eq3_test.cpp ]
+ #[ run boost_bind_compatibility/bind_fastcall_mf_test.cpp ] # problem: result_of can't handle the fastcall attribute
+ #[ run boost_bind_compatibility/bind_fastcall_test.cpp ] # problem: result_of can't handle the fastcall attribute
+ [ run boost_bind_compatibility/bind_fn2_test.cpp ]
+ [ run boost_bind_compatibility/bind_function_test.cpp ] # problem: fn.contains not working properly
+ [ run boost_bind_compatibility/bind_mf2_test.cpp ]
+ [ run boost_bind_compatibility/bind_not_test.cpp ]
+ [ run boost_bind_compatibility/bind_placeholer_test.cpp ] # problem: real custom placeholders, like in the original test not implemented yet
+ [ run boost_bind_compatibility/bind_ref_test.cpp ]
+ [ run boost_bind_compatibility/bind_rel_test.cpp ]
+ [ run boost_bind_compatibility/bind_rvalue_test.cpp ]
+ [ run boost_bind_compatibility/bind_rv_sp_test.cpp ]
+ [ run boost_bind_compatibility/bind_stateful_test.cpp ] # problem: only const operator() overloads are regarded
+ #[ run boost_bind_compatibility/bind_stdcall_mf_test.cpp ] # problem: result_of can't handle the stdcall attribute
+ #[ run boost_bind_compatibility/bind_stdcall_test.cpp ] # problem: result_of can't handle the stdcall attribute
+ [ run boost_bind_compatibility/bind_test.cpp ]
+ ;
+
test-suite phoenix_include :
[ run include/bind_bind.cpp ]
#[ run include/bind_bind_member_function.cpp ]
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,76 @@
+/*==============================================================================
+ Copyright (c) 2008 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/operator.hpp>
+
+#include <iostream>
+#include <boost/detail/lightweight_test.hpp>
+
+bool
+f(bool x)
+{
+ return x;
+}
+
+bool
+g(bool x)
+{
+ return !x;
+}
+
+bool
+h()
+{
+ BOOST_ERROR("Short-circuit evaluation failure");
+ return false;
+}
+
+template <typename F, typename A1, typename A2, typename R>
+void
+test(F f, A1 a1, A2 a2, R r)
+{
+ BOOST_TEST(f(a1, a2) == r);
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+ using boost::phoenix::placeholders::_2;
+
+ // &&
+
+ test(bind(f, true) && bind(g, true), false, false, f(true) && g(true));
+ test(bind(f, true) && bind(g, false), false, false, f(true) && g(false));
+
+ test(bind(f, false) && bind(h), false, false, f(false) && h());
+
+ test(bind(f, _1) && bind(g, _2), true, true, f(true) && g(true));
+ test(bind(f, _1) && bind(g, _2), true, false, f(true) && g(false));
+
+ test(bind(f, _1) && bind(h), false, false, f(false) && h());
+
+ // ||
+
+ test(bind(f, false) || bind(g, true), false, false, f(false) || g(true));
+ test(bind(f, false) || bind(g, false), false, false, f(false) || g(false));
+
+ test(bind(f, true) || bind(h), false, false, f(true) || h());
+
+ test(bind(f, _1) || bind(g, _2), false, true, f(false) || g(true));
+ test(bind(f, _1) || bind(g, _2), false, false, f(false) || g(false));
+
+ test(bind(f, _1) || (h), true, false, f(true) || h());
+
+ //
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,147 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <boost/ref.hpp>
+
+struct X
+{
+ mutable unsigned int hash;
+
+ X(): hash(0) {}
+
+ int f0() { f1(17); return 0; }
+ int g0() const { g1(17); return 0; }
+
+ int f1(int a1) { hash = (hash * 17041 + a1) % 32768; return 0; }
+ int g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
+
+ int f2(int a1, int a2) { f1(a1); f1(a2); return 0; }
+ int g2(int a1, int a2) const { g1(a1); g1(a2); return 0; }
+
+ int f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); return 0; }
+ int g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); return 0; }
+
+ int f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); return 0; }
+ int g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); return 0; }
+
+ int f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); return 0; }
+ int g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); return 0; }
+
+ int f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
+ int g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); return 0; }
+
+ int f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); return 0; }
+ int g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); return 0; }
+
+ int f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); return 0; }
+ int g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); return 0; }
+};
+
+void member_function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+
+ X x;
+
+ // 0
+
+ bind(&X::f0, &x)();
+ bind(&X::f0, ref(x))();
+ bind(&X::f0, x)();
+
+ bind(&X::g0, &x)();
+ bind(&X::g0, x)();
+ bind(&X::g0, ref(x))();
+
+ // 1
+
+ bind(&X::f1, &x, 1)();
+ bind(&X::f1, ref(x), 1)();
+
+ bind(&X::g1, &x, 1)();
+ bind(&X::g1, x, 1)();
+ bind(&X::g1, ref(x), 1)();
+
+ // 2
+
+ bind(&X::f2, &x, 1, 2)();
+ bind(&X::f2, ref(x), 1, 2)();
+
+ bind(&X::g2, &x, 1, 2)();
+ bind(&X::g2, x, 1, 2)();
+ bind(&X::g2, ref(x), 1, 2)();
+
+ // 3
+
+ bind(&X::f3, &x, 1, 2, 3)();
+ bind(&X::f3, ref(x), 1, 2, 3)();
+
+ bind(&X::g3, &x, 1, 2, 3)();
+ bind(&X::g3, x, 1, 2, 3)();
+ bind(&X::g3, ref(x), 1, 2, 3)();
+
+ // 4
+
+ bind(&X::f4, &x, 1, 2, 3, 4)();
+ bind(&X::f4, ref(x), 1, 2, 3, 4)();
+
+ bind(&X::g4, &x, 1, 2, 3, 4)();
+ bind(&X::g4, x, 1, 2, 3, 4)();
+ bind(&X::g4, ref(x), 1, 2, 3, 4)();
+
+ // 5
+
+ bind(&X::f5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::f5, ref(x), 1, 2, 3, 4, 5)();
+
+ bind(&X::g5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, ref(x), 1, 2, 3, 4, 5)();
+
+ // 6
+
+ bind(&X::f6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::f6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ bind(&X::g6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ // 7
+
+ bind(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::f7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::f8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ bind(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ BOOST_TEST( x.hash == 23558 );
+}
+
+int main()
+{
+ member_function_test();
+ return boost::report_errors();
+}
+
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,184 @@
+/*==============================================================================
+ Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
+ Copyright (c) 2001 David Abrahams
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+//
+
+long f_0()
+{
+ return 17041L;
+}
+
+long f_1(long a)
+{
+ return a;
+}
+
+long f_2(long a, long b)
+{
+ return a + 10 * b;
+}
+
+long f_3(long a, long b, long c)
+{
+ return a + 10 * b + 100 * c;
+}
+
+long f_4(long a, long b, long c, long d)
+{
+ return a + 10 * b + 100 * c + 1000 * d;
+}
+
+long f_5(long a, long b, long c, long d, long e)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+long f_6(long a, long b, long c, long d, long e, long f)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+long f_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+long f_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+long f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+long global_result;
+
+void fv_0()
+{
+ global_result = 17041L;
+}
+
+void fv_1(long a)
+{
+ global_result = a;
+}
+
+void fv_2(long a, long b)
+{
+ global_result = a + 10 * b;
+}
+
+void fv_3(long a, long b, long c)
+{
+ global_result = a + 10 * b + 100 * c;
+}
+
+void fv_4(long a, long b, long c, long d)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d;
+}
+
+void fv_5(long a, long b, long c, long d, long e)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+void fv_6(long a, long b, long c, long d, long e, long f)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+void fv_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+void fv_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+void fv_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+template<class F, class A> long test(F const & f, A const & a)
+{
+ return f(a);
+}
+
+template<class F, class A> long testv(F const & f, A const & a)
+{
+ f(a);
+ return global_result;
+}
+
+void function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ int const i = 1;
+
+ BOOST_TEST( test( bind(f_0), i ) == 17041L );
+ BOOST_TEST( test( bind(f_1, _1), i ) == 1L );
+ BOOST_TEST( test( bind(f_2, _1, 2), i ) == 21L );
+ BOOST_TEST( test( bind(f_3, _1, 2, 3), i ) == 321L );
+ BOOST_TEST( test( bind(f_4, _1, 2, 3, 4), i ) == 4321L );
+ BOOST_TEST( test( bind(f_5, _1, 2, 3, 4, 5), i ) == 54321L );
+ BOOST_TEST( test( bind(f_6, _1, 2, 3, 4, 5, 6), i ) == 654321L );
+ BOOST_TEST( test( bind(f_7, _1, 2, 3, 4, 5, 6, 7), i ) == 7654321L );
+ BOOST_TEST( test( bind(f_8, _1, 2, 3, 4, 5, 6, 7, 8), i ) == 87654321L );
+ BOOST_TEST( test( bind(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9), i ) == 987654321L );
+
+ BOOST_TEST( testv( bind(fv_0), i ) == 17041L );
+ BOOST_TEST( testv( bind(fv_1, _1), i ) == 1L );
+ BOOST_TEST( testv( bind(fv_2, _1, 2), i ) == 21L );
+ BOOST_TEST( testv( bind(fv_3, _1, 2, 3), i ) == 321L );
+ BOOST_TEST( testv( bind(fv_4, _1, 2, 3, 4), i ) == 4321L );
+ BOOST_TEST( testv( bind(fv_5, _1, 2, 3, 4, 5), i ) == 54321L );
+ BOOST_TEST( testv( bind(fv_6, _1, 2, 3, 4, 5, 6), i ) == 654321L );
+ BOOST_TEST( testv( bind(fv_7, _1, 2, 3, 4, 5, 6, 7), i ) == 7654321L );
+ BOOST_TEST( testv( bind(fv_8, _1, 2, 3, 4, 5, 6, 7, 8), i ) == 87654321L );
+ BOOST_TEST( testv( bind(fv_9, _1, 2, 3, 4, 5, 6, 7, 8, 9), i ) == 987654321L );
+}
+
+int main()
+{
+ function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,162 @@
+/*==============================================================================
+ Copyright (c) 2004 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ typedef int result_type;
+
+ int operator()()
+ {
+ return 17041;
+ }
+
+ int operator()() const
+ {
+ return -17041;
+ }
+
+ int operator()(int x1)
+ {
+ return x1;
+ }
+
+ int operator()(int x1) const
+ {
+ return -x1;
+ }
+
+ int operator()(int x1, int x2)
+ {
+ return x1+x2;
+ }
+
+ int operator()(int x1, int x2) const
+ {
+ return -(x1+x2);
+ }
+
+ int operator()(int x1, int x2, int x3)
+ {
+ return x1+x2+x3;
+ }
+
+ int operator()(int x1, int x2, int x3) const
+ {
+ return -(x1+x2+x3);
+ }
+
+ int operator()(int x1, int x2, int x3, int x4)
+ {
+ return x1+x2+x3+x4;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4) const
+ {
+ return -(x1+x2+x3+x4);
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5)
+ {
+ return x1+x2+x3+x4+x5;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5) const
+ {
+ return -(x1+x2+x3+x4+x5);
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6)
+ {
+ return x1+x2+x3+x4+x5+x6;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6) const
+ {
+ return -(x1+x2+x3+x4+x5+x6);
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7)
+ {
+ return x1+x2+x3+x4+x5+x6+x7;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7) const
+ {
+ return -(x1+x2+x3+x4+x5+x6+x7);
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8)
+ {
+ return x1+x2+x3+x4+x5+x6+x7+x8;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8) const
+ {
+ return -(x1+x2+x3+x4+x5+x6+x7+x8);
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9)
+ {
+ return x1+x2+x3+x4+x5+x6+x7+x8+x9;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9) const
+ {
+ return -(x1+x2+x3+x4+x5+x6+x7+x8+x9);
+ }
+};
+
+template<class F> void test(F f, int r)
+{
+ F const & cf = f;
+ BOOST_TEST( cf() == -r );
+ //BOOST_TEST( f() == r );
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+
+ test( bind(X()), 17041);
+ test( bind(X(), 1), 1);
+ test( bind(X(), 1, 2), 1+2);
+ test( bind(X(), 1, 2, 3), 1+2+3);
+ test( bind(X(), 1, 2, 3, 4), 1+2+3+4);
+ test( bind(X(), 1, 2, 3, 4, 5), 1+2+3+4+5);
+ test( bind(X(), 1, 2, 3, 4, 5, 6), 1+2+3+4+5+6);
+ test( bind(X(), 1, 2, 3, 4, 5, 6, 7), 1+2+3+4+5+6+7);
+ test( bind(X(), 1, 2, 3, 4, 5, 6, 7, 8), 1+2+3+4+5+6+7+8);
+ test( bind(X(), 1, 2, 3, 4, 5, 6, 7, 8, 9), 1+2+3+4+5+6+7+8+9);
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,74 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+#include <string>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ int m;
+};
+
+struct Y
+{
+ char m[ 64 ];
+};
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::placeholders::_1;
+
+ X x = { 0 };
+ X * px = &x;
+
+ bind( &X::m, _1 )( px ) = 42;
+
+ BOOST_TEST( x.m == 42 );
+
+ bind( &X::m, ref(x) )() = 17041;
+
+ BOOST_TEST( x.m == 17041 );
+
+ X const * pcx = &x;
+
+ BOOST_TEST( bind( &X::m, _1 )( pcx ) == 17041L );
+ BOOST_TEST( bind( &X::m, pcx )() == 17041L );
+
+ Y y = { "test" };
+ std::string v( "test" );
+
+ BOOST_TEST( bind( &Y::m, &y )() == v );
+ BOOST_TEST( bind( &Y::m, &y )() == v );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,49 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+#include <utility>
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ typedef std::pair<int, int> pair_type;
+
+ pair_type pair( 10, 20 );
+
+ int const & x = bind( &pair_type::first, _1 )( pair );
+
+ BOOST_TEST( &pair.first == &x );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,77 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ int m;
+};
+
+X f( int v )
+{
+ X r = { v };
+ return r;
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::placeholders::_1;
+
+ X x = { 17041 };
+ X * px = &x;
+
+ BOOST_TEST( bind( &X::m, _1 )( x ) == 17041 );
+ BOOST_TEST( bind( &X::m, _1 )( px ) == 17041 );
+
+ BOOST_TEST( bind( &X::m, x )() == 17041 );
+ BOOST_TEST( bind( &X::m, px )() == 17041 );
+ BOOST_TEST( bind( &X::m, ref(x) )() == 17041 );
+
+
+ X const cx = x;
+ X const * pcx = &cx;
+
+ BOOST_TEST( bind( &X::m, _1 )( cx ) == 17041 );
+ BOOST_TEST( bind( &X::m, _1 )( pcx ) == 17041 );
+
+ BOOST_TEST( bind( &X::m, cx )() == 17041 );
+ BOOST_TEST( bind( &X::m, pcx )() == 17041 );
+ BOOST_TEST( bind( &X::m, ref(cx) )() == 17041 );
+
+ int const v = 42;
+
+ BOOST_TEST( bind( &X::m, bind( f, _1 ) )( v ) == v );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,52 @@
+/*==============================================================================
+ Copyright (c) 2004, 2005, 2009 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/function_equal.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+void f( int )
+{
+}
+
+int g( int i )
+{
+ return i + 5;
+}
+
+template< class F > void test_self_equal( F f )
+{
+#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+ using boost::function_equal;
+#endif
+
+ BOOST_TEST( function_equal( f, f ) );
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ test_self_equal( bind( f, _1 ) );
+ test_self_equal( bind( g, _1 ) );
+ test_self_equal( bind( f, bind( g, _1 ) ) );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,48 @@
+/*==============================================================================
+ Copyright (c) 2004, 2005, 2009 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/function_equal.hpp>
+#include <boost/weak_ptr.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int f( boost::weak_ptr<void> wp )
+{
+ return wp.use_count();
+}
+
+template< class F > void test_self_equal( F f )
+{
+#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+ using boost::function_equal;
+#endif
+
+ BOOST_TEST( function_equal( f, f ) );
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ test_self_equal( bind( f, _1 ) );
+ test_self_equal( bind( f, boost::weak_ptr<void>() ) );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,438 @@
+/*==============================================================================
+ Copyright (c) 2004, 2005, 2009 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+# include <boost/function_equal.hpp>
+#endif
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ int i_;
+
+ explicit X(int i): i_(i)
+ {
+ }
+
+ bool operator==(X const & rhs) const
+ {
+ return i_ == rhs.i_;
+ }
+};
+
+// f_*
+
+int f_0()
+{
+ return 0;
+}
+
+int f_1(X)
+{
+ return 0;
+}
+
+int f_2(X, X)
+{
+ return 0;
+}
+
+int f_3(X, X, X)
+{
+ return 0;
+}
+
+int f_4(X, X, X, X)
+{
+ return 0;
+}
+
+int f_5(X, X, X, X, X)
+{
+ return 0;
+}
+
+int f_6(X, X, X, X, X, X)
+{
+ return 0;
+}
+
+int f_7(X, X, X, X, X, X, X)
+{
+ return 0;
+}
+
+int f_8(X, X, X, X, X, X, X, X)
+{
+ return 0;
+}
+
+int f_9(X, X, X, X, X, X, X, X, X)
+{
+ return 0;
+}
+
+// fv_*
+
+void fv_0()
+{
+}
+
+void fv_1(X)
+{
+}
+
+void fv_2(X, X)
+{
+}
+
+void fv_3(X, X, X)
+{
+}
+
+void fv_4(X, X, X, X)
+{
+}
+
+void fv_5(X, X, X, X, X)
+{
+}
+
+void fv_6(X, X, X, X, X, X)
+{
+}
+
+void fv_7(X, X, X, X, X, X, X)
+{
+}
+
+void fv_8(X, X, X, X, X, X, X, X)
+{
+}
+
+void fv_9(X, X, X, X, X, X, X, X, X)
+{
+}
+
+template<class F> void test_eq(F f1, F f2)
+{
+#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+ using boost::function_equal;
+
+#endif
+
+ BOOST_TEST( function_equal( f1, f2 ) );
+}
+
+template<class F> void test_ne(F f1, F f2)
+{
+#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+ using boost::function_equal;
+
+#endif
+
+ BOOST_TEST( !function_equal( f1, f2 ) );
+}
+
+using boost::phoenix::bind;
+using boost::phoenix::ref;
+using boost::phoenix::placeholders::_1;
+using boost::phoenix::placeholders::_2;
+using boost::phoenix::placeholders::_3;
+using boost::phoenix::placeholders::_4;
+using boost::phoenix::placeholders::_5;
+using boost::phoenix::placeholders::_6;
+using boost::phoenix::placeholders::_7;
+using boost::phoenix::placeholders::_8;
+using boost::phoenix::placeholders::_9;
+
+// 0
+
+template<class F> void test_0(F f)
+{
+ test_eq( bind(f), bind(f) );
+}
+
+// 1
+
+template<class F, class V> void test_1_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1), bind(f, v1) );
+ //test_ne( bind(f, v1), bind(f, v2) );
+}
+
+template<class F> void test_1(F f)
+{
+ test_eq( bind(f, _1), bind(f, _1) );
+
+ test_1_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_1_( f, ref(a), ref(b) );
+}
+
+// 2
+
+template<class F, class V> void test_2_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1), bind(f, v1, v1) );
+ //test_ne( bind(f, v1, v1), bind(f, v1, v2) );
+ //test_ne( bind(f, v1, v1), bind(f, v2, v1) );
+}
+
+template<class F> void test_2(F f)
+{
+ test_eq( bind(f, _1, _2), bind(f, _1, _2) );
+
+ test_2_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_2_( f, ref(a), ref(b) );
+}
+
+// 3
+
+template<class F, class V> void test_3_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1), bind(f, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1), bind(f, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1), bind(f, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1), bind(f, v2, v1, v1) );
+}
+
+template<class F> void test_3(F f)
+{
+ test_eq( bind(f, _1, _2, _3), bind(f, _1, _2, _3) );
+
+ test_3_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_3_( f, ref(a), ref(b) );
+}
+
+// 4
+
+template<class F, class V> void test_4_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1, v1), bind(f, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1), bind(f, v1, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1, v1), bind(f, v1, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1), bind(f, v1, v2, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1), bind(f, v2, v1, v1, v1) );
+}
+
+template<class F> void test_4(F f)
+{
+ test_eq( bind(f, _1, _2, _3, _4), bind(f, _1, _2, _3, _4) );
+
+ test_4_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_4_( f, ref(a), ref(b) );
+}
+
+// 5
+
+template<class F, class V> void test_5_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1), bind(f, v1, v1, v2, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1), bind(f, v1, v2, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1), bind(f, v2, v1, v1, v1, v1) );
+}
+
+template<class F> void test_5(F f)
+{
+ test_eq( bind(f, _1, _2, _3, _4, _5), bind(f, _1, _2, _3, _4, _5) );
+
+ test_5_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_5_( f, ref(a), ref(b) );
+}
+
+// 6
+
+template<class F, class V> void test_6_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v2, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v2, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v1, v2, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1), bind(f, v2, v1, v1, v1, v1, v1) );
+}
+
+template<class F> void test_6(F f)
+{
+ test_eq( bind(f, _1, _2, _3, _4, _5, _6), bind(f, _1, _2, _3, _4, _5, _6) );
+
+ test_6_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_6_( f, ref(a), ref(b) );
+}
+
+// 7
+
+template<class F, class V> void test_7_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v2, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v2, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v2, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v2, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1), bind(f, v2, v1, v1, v1, v1, v1, v1) );
+}
+
+template<class F> void test_7(F f)
+{
+ test_eq( bind(f, _1, _2, _3, _4, _5, _6, _7), bind(f, _1, _2, _3, _4, _5, _6, _7) );
+
+ test_7_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_7_( f, ref(a), ref(b) );
+}
+
+// 8
+
+template<class F, class V> void test_8_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v2, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v2, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v2, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v2, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v2, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v2, v1, v1, v1, v1, v1, v1, v1) );
+}
+
+template<class F> void test_8(F f)
+{
+ test_eq( bind(f, _1, _2, _3, _4, _5, _6, _7, _8), bind(f, _1, _2, _3, _4, _5, _6, _7, _8) );
+
+ test_8_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_8_( f, ref(a), ref(b) );
+}
+
+// 9
+
+template<class F, class V> void test_9_(F f, V v1, V v2)
+{
+ test_eq( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v2) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v1, v2, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v1, v2, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v1, v2, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v1, v2, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v1, v2, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v1, v2, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v1, v2, v1, v1, v1, v1, v1, v1, v1) );
+ //test_ne( bind(f, v1, v1, v1, v1, v1, v1, v1, v1, v1), bind(f, v2, v1, v1, v1, v1, v1, v1, v1, v1) );
+}
+
+template<class F> void test_9(F f)
+{
+ test_eq( bind(f, _1, _2, _3, _4, _5, _6, _7, _8, _9), bind(f, _1, _2, _3, _4, _5, _6, _7, _8, _9) );
+
+ test_9_( f, X(1), X(2) );
+
+ X a(0), b(0);
+ test_9_( f, ref(a), ref(b) );
+}
+
+int main()
+{
+ // 0
+
+ test_0( f_0 );
+ test_0( fv_0 );
+
+ // 1
+
+ test_1( f_1 );
+ test_1( fv_1 );
+
+ // 2
+
+ test_2( f_2 );
+ test_2( fv_2 );
+
+ // 3
+
+ test_3( f_3 );
+ test_3( fv_3 );
+
+ // 4
+
+ test_4( f_4 );
+ test_4( fv_4 );
+
+ // 5
+
+ test_5( f_5 );
+ test_5( fv_5 );
+
+ // 6
+
+ test_6( f_6 );
+ test_6( fv_6 );
+
+ // 7
+
+ test_7( f_7 );
+ test_7( fv_7 );
+
+ // 8
+
+ test_8( f_8 );
+ test_8( fv_8 );
+
+ // 9
+
+ test_9( f_9 );
+ test_9( fv_9 );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,165 @@
+/*==============================================================================
+ Copyright (c) 2001 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#define BOOST_MEM_FN_ENABLE_FASTCALL
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ mutable unsigned int hash;
+
+ X(): hash(0) {}
+
+ void __fastcall f0() { f1(17); }
+ void __fastcall g0() const { g1(17); }
+
+ void __fastcall f1(int a1) { hash = (hash * 17041 + a1) % 32768; }
+ void __fastcall g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; }
+
+ void __fastcall f2(int a1, int a2) { f1(a1); f1(a2); }
+ void __fastcall g2(int a1, int a2) const { g1(a1); g1(a2); }
+
+ void __fastcall f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); }
+ void __fastcall g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); }
+
+ void __fastcall f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); }
+ void __fastcall g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); }
+
+ void __fastcall f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); }
+ void __fastcall g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); }
+
+ void __fastcall f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); }
+ void __fastcall g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); }
+
+ void __fastcall f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); }
+ void __fastcall g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); }
+
+ void __fastcall f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); }
+ void __fastcall g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); }
+};
+
+void member_function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+
+ X x;
+
+ // 0
+
+ bind(&X::f0, &x)();
+ bind(&X::f0, ref(x))();
+
+ bind(&X::g0, &x)();
+ bind(&X::g0, x)();
+ bind(&X::g0, ref(x))();
+
+ // 1
+
+ bind(&X::f1, &x, 1)();
+ bind(&X::f1, ref(x), 1)();
+
+ bind(&X::g1, &x, 1)();
+ bind(&X::g1, x, 1)();
+ bind(&X::g1, ref(x), 1)();
+
+ // 2
+
+ bind(&X::f2, &x, 1, 2)();
+ bind(&X::f2, ref(x), 1, 2)();
+
+ bind(&X::g2, &x, 1, 2)();
+ bind(&X::g2, x, 1, 2)();
+ bind(&X::g2, ref(x), 1, 2)();
+
+ // 3
+
+ bind(&X::f3, &x, 1, 2, 3)();
+ bind(&X::f3, ref(x), 1, 2, 3)();
+
+ bind(&X::g3, &x, 1, 2, 3)();
+ bind(&X::g3, x, 1, 2, 3)();
+ bind(&X::g3, ref(x), 1, 2, 3)();
+
+ // 4
+
+ bind(&X::f4, &x, 1, 2, 3, 4)();
+ bind(&X::f4, ref(x), 1, 2, 3, 4)();
+
+ bind(&X::g4, &x, 1, 2, 3, 4)();
+ bind(&X::g4, x, 1, 2, 3, 4)();
+ bind(&X::g4, ref(x), 1, 2, 3, 4)();
+
+ // 5
+
+ bind(&X::f5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::f5, ref(x), 1, 2, 3, 4, 5)();
+
+ bind(&X::g5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, ref(x), 1, 2, 3, 4, 5)();
+
+ // 6
+
+ bind(&X::f6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::f6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ bind(&X::g6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ // 7
+
+ bind(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::f7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::f8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ bind(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ BOOST_TEST( x.hash == 23558 );
+}
+
+int main()
+{
+ member_function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,110 @@
+/*==============================================================================
+ Copyright (c) 2002 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#define BOOST_BIND_ENABLE_FASTCALL
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+//
+
+long __fastcall f_0()
+{
+ return 17041L;
+}
+
+long __fastcall f_1(long a)
+{
+ return a;
+}
+
+long __fastcall f_2(long a, long b)
+{
+ return a + 10 * b;
+}
+
+long __fastcall f_3(long a, long b, long c)
+{
+ return a + 10 * b + 100 * c;
+}
+
+long __fastcall f_4(long a, long b, long c, long d)
+{
+ return a + 10 * b + 100 * c + 1000 * d;
+}
+
+long __fastcall f_5(long a, long b, long c, long d, long e)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+long __fastcall f_6(long a, long b, long c, long d, long e, long f)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+long __fastcall f_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+long __fastcall f_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+long __fastcall f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+void function_test()
+{
+ using boost::phoenix::bind;
+
+ int const i = 1;
+
+ BOOST_TEST( bind(f_0)(i) == 17041L );
+ BOOST_TEST( bind(f_1, _1)(i) == 1L );
+ BOOST_TEST( bind(f_2, _1, 2)(i) == 21L );
+ BOOST_TEST( bind(f_3, _1, 2, 3)(i) == 321L );
+ BOOST_TEST( bind(f_4, _1, 2, 3, 4)(i) == 4321L );
+ BOOST_TEST( bind(f_5, _1, 2, 3, 4, 5)(i) == 54321L );
+ BOOST_TEST( bind(f_6, _1, 2, 3, 4, 5, 6)(i) == 654321L );
+ BOOST_TEST( bind(f_7, _1, 2, 3, 4, 5, 6, 7)(i) == 7654321L );
+ BOOST_TEST( bind(f_8, _1, 2, 3, 4, 5, 6, 7, 8)(i) == 87654321L );
+ BOOST_TEST( bind(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i) == 987654321L );
+}
+
+int main()
+{
+ function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,171 @@
+/*==============================================================================
+ Copyright (c) 2005, 2008 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+long global_result;
+
+// long
+
+long f_0()
+{
+ return global_result = 17041L;
+}
+
+long f_1(long a)
+{
+ return global_result = a;
+}
+
+long f_2(long a, long b)
+{
+ return global_result = a + 10 * b;
+}
+
+long f_3(long a, long b, long c)
+{
+ return global_result = a + 10 * b + 100 * c;
+}
+
+long f_4(long a, long b, long c, long d)
+{
+ return global_result = a + 10 * b + 100 * c + 1000 * d;
+}
+
+long f_5(long a, long b, long c, long d, long e)
+{
+ return global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+long f_6(long a, long b, long c, long d, long e, long f)
+{
+ return global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+long f_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ return global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+long f_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ return global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+long f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ return global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+// void
+
+void fv_0()
+{
+ global_result = 17041L;
+}
+
+void fv_1(long a)
+{
+ global_result = a;
+}
+
+void fv_2(long a, long b)
+{
+ global_result = a + 10 * b;
+}
+
+void fv_3(long a, long b, long c)
+{
+ global_result = a + 10 * b + 100 * c;
+}
+
+void fv_4(long a, long b, long c, long d)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d;
+}
+
+void fv_5(long a, long b, long c, long d, long e)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+void fv_6(long a, long b, long c, long d, long e, long f)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+void fv_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+void fv_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+void fv_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+void function_test()
+{
+ using boost::phoenix::bind;
+
+ bind( f_0 )(); BOOST_TEST( global_result == 17041L );
+ bind( f_1, 1 )(); BOOST_TEST( global_result == 1L );
+ bind( f_2, 1, 2 )(); BOOST_TEST( global_result == 21L );
+ bind( f_3, 1, 2, 3 )(); BOOST_TEST( global_result == 321L );
+ bind( f_4, 1, 2, 3, 4 )(); BOOST_TEST( global_result == 4321L );
+ bind( f_5, 1, 2, 3, 4, 5 )(); BOOST_TEST( global_result == 54321L );
+ bind( f_6, 1, 2, 3, 4, 5, 6 )(); BOOST_TEST( global_result == 654321L );
+ bind( f_7, 1, 2, 3, 4, 5, 6, 7 )(); BOOST_TEST( global_result == 7654321L );
+ bind( f_8, 1, 2, 3, 4, 5, 6, 7, 8 )(); BOOST_TEST( global_result == 87654321L );
+ bind( f_9, 1, 2, 3, 4, 5, 6, 7, 8, 9 )(); BOOST_TEST( global_result == 987654321L );
+
+ bind( fv_0 )(); BOOST_TEST( global_result == 17041L );
+ bind( fv_1, 1 )(); BOOST_TEST( global_result == 1L );
+ bind( fv_2, 1, 2 )(); BOOST_TEST( global_result == 21L );
+ bind( fv_3, 1, 2, 3 )(); BOOST_TEST( global_result == 321L );
+ bind( fv_4, 1, 2, 3, 4 )(); BOOST_TEST( global_result == 4321L );
+ bind( fv_5, 1, 2, 3, 4, 5 )(); BOOST_TEST( global_result == 54321L );
+ bind( fv_6, 1, 2, 3, 4, 5, 6 )(); BOOST_TEST( global_result == 654321L );
+ bind( fv_7, 1, 2, 3, 4, 5, 6, 7 )(); BOOST_TEST( global_result == 7654321L );
+ bind( fv_8, 1, 2, 3, 4, 5, 6, 7, 8 )(); BOOST_TEST( global_result == 87654321L );
+ bind( fv_9, 1, 2, 3, 4, 5, 6, 7, 8, 9 )(); BOOST_TEST( global_result == 987654321L );
+}
+
+int main()
+{
+ function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,79 @@
+/*==============================================================================
+ Copyright (c) 2005, 2008 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ mutable unsigned int hash;
+
+ typedef int result_type;
+
+ X(): hash(0) {}
+
+ int operator()() const { operator()(17); return 0; }
+ int operator()(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
+ int operator()(int a1, int a2) const { operator()(a1); operator()(a2); return 0; }
+ int operator()(int a1, int a2, int a3) const { operator()(a1, a2); operator()(a3); return 0; }
+ int operator()(int a1, int a2, int a3, int a4) const { operator()(a1, a2, a3); operator()(a4); return 0; }
+ int operator()(int a1, int a2, int a3, int a4, int a5) const { operator()(a1, a2, a3, a4); operator()(a5); return 0; }
+ int operator()(int a1, int a2, int a3, int a4, int a5, int a6) const { operator()(a1, a2, a3, a4, a5); operator()(a6); return 0; }
+ int operator()(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { operator()(a1, a2, a3, a4, a5, a6); operator()(a7); return 0; }
+ int operator()(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { operator()(a1, a2, a3, a4, a5, a6, a7); operator()(a8); return 0; }
+ int operator()(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) const { operator()(a1, a2, a3, a4, a5, a6, a7, a8); operator()(a9); return 0; }
+};
+
+void function_object_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+
+ X x;
+
+ bind(ref(x) )();
+ bind(ref(x), 1 )();
+ bind(ref(x), 1, 2 )();
+ bind(ref(x), 1, 2, 3 )();
+ bind(ref(x), 1, 2, 3, 4 )();
+ bind(ref(x), 1, 2, 3, 4, 5 )();
+ bind(ref(x), 1, 2, 3, 4, 5, 6 )();
+ bind(ref(x), 1, 2, 3, 4, 5, 6, 7)();
+ bind(ref(x), 1, 2, 3, 4, 5, 6, 7, 8 )();
+ bind(ref(x), 1, 2, 3, 4, 5, 6, 7, 8, 9 )();
+
+ BOOST_TEST( x.hash == 9932 );
+}
+
+int main()
+{
+ function_object_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,79 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+#include <boost/function.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int f( int x )
+{
+ return x;
+}
+
+int g( int x )
+{
+ return x + 1;
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+
+ boost::function0<int> fn;
+
+ BOOST_TEST( !fn.contains( bind( f, 1 ) ) );
+ BOOST_TEST( !fn.contains( bind( f, 2 ) ) );
+ BOOST_TEST( !fn.contains( bind( g, 1 ) ) );
+
+ fn = bind( f, 1 );
+
+ BOOST_TEST( fn() == 1 );
+
+ BOOST_TEST( fn.contains( bind( f, 1 ) ) );
+ //BOOST_TEST( !fn.contains( bind( f, 2 ) ) );
+ //BOOST_TEST( !fn.contains( bind( g, 1 ) ) );
+
+ fn = bind( f, 2 );
+
+ BOOST_TEST( fn() == 2 );
+
+ //BOOST_TEST( !fn.contains( bind( f, 1 ) ) );
+ BOOST_TEST( fn.contains( bind( f, 2 ) ) );
+ //BOOST_TEST( !fn.contains( bind( g, 1 ) ) );
+
+ fn = bind( g, 1 );
+
+ BOOST_TEST( fn() == 2 );
+
+ //BOOST_TEST( !fn.contains( bind( f, 1 ) ) );
+ //BOOST_TEST( !fn.contains( bind( f, 2 ) ) );
+ BOOST_TEST( fn.contains( bind( g, 1 ) ) );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,42 @@
+/*==============================================================================
+ Copyright (c) 2005 Markus Schoepflin
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+template<class T> void value();
+
+void f0() { }
+void f1(int) { }
+void f2(int, int) { }
+void f3(int, int, int) { }
+void f4(int, int, int, int) { }
+void f5(int, int, int, int, int) { }
+void f6(int, int, int, int, int, int) { }
+void f7(int, int, int, int, int, int, int) { }
+void f8(int, int, int, int, int, int, int, int) { }
+void f9(int, int, int, int, int, int, int, int, int) { }
+
+int main()
+{
+ using boost::phoenix::bind;
+
+ bind(f0);
+ bind(f1, 0);
+ bind(f2, 0, 0);
+ bind(f3, 0, 0, 0);
+ bind(f4, 0, 0, 0, 0);
+ bind(f5, 0, 0, 0, 0, 0);
+ bind(f6, 0, 0, 0, 0, 0, 0);
+ bind(f7, 0, 0, 0, 0, 0, 0, 0);
+ bind(f8, 0, 0, 0, 0, 0, 0, 0, 0);
+ bind(f9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ return 0;
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,163 @@
+/*==============================================================================
+ Copyright (c) 2005, 2008 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ mutable unsigned int hash;
+
+ X(): hash(0) {}
+
+ int f0() { f1(17); return 0; }
+ int g0() const { g1(17); return 0; }
+
+ int f1(int a1) { hash = (hash * 17041 + a1) % 32768; return 0; }
+ int g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
+
+ int f2(int a1, int a2) { f1(a1); f1(a2); return 0; }
+ int g2(int a1, int a2) const { g1(a1); g1(a2); return 0; }
+
+ int f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); return 0; }
+ int g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); return 0; }
+
+ int f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); return 0; }
+ int g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); return 0; }
+
+ int f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); return 0; }
+ int g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); return 0; }
+
+ int f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
+ int g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); return 0; }
+
+ int f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); return 0; }
+ int g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); return 0; }
+
+ int f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); return 0; }
+ int g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); return 0; }
+};
+
+void member_function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+
+ X x;
+
+ // 0
+
+ bind(&X::f0, &x )();
+ bind(&X::f0, ref(x) )();
+
+ bind(&X::g0, &x )();
+ bind(&X::g0, x )();
+ bind(&X::g0, ref(x) )();
+
+ // 1
+
+ bind(&X::f1, &x, 1 )();
+ bind(&X::f1, ref(x), 1 )();
+
+ bind(&X::g1, &x, 1 )();
+ bind(&X::g1, x, 1 )();
+ bind(&X::g1, ref(x), 1 )();
+
+ // 2
+
+ bind(&X::f2, &x, 1, 2 )();
+ bind(&X::f2, ref(x), 1, 2 )();
+
+ bind(&X::g2, &x, 1, 2 )();
+ bind(&X::g2, x, 1, 2 )();
+ bind(&X::g2, ref(x), 1, 2 )();
+
+ // 3
+
+ bind(&X::f3, &x, 1, 2, 3 )();
+ bind(&X::f3, ref(x), 1, 2, 3 )();
+
+ bind(&X::g3, &x, 1, 2, 3 )();
+ bind(&X::g3, x, 1, 2, 3 )();
+ bind(&X::g3, ref(x), 1, 2, 3 )();
+
+ // 4
+
+ bind(&X::f4, &x, 1, 2, 3, 4 )();
+ bind(&X::f4, ref(x), 1, 2, 3, 4 )();
+
+ bind(&X::g4, &x, 1, 2, 3, 4 )();
+ bind(&X::g4, x, 1, 2, 3, 4 )();
+ bind(&X::g4, ref(x), 1, 2, 3, 4 )();
+
+ // 5
+
+ bind(&X::f5, &x, 1, 2, 3, 4, 5 )();
+ bind(&X::f5, ref(x), 1, 2, 3, 4, 5 )();
+
+ bind(&X::g5, &x, 1, 2, 3, 4, 5 )();
+ bind(&X::g5, x, 1, 2, 3, 4, 5 )();
+ bind(&X::g5, ref(x), 1, 2, 3, 4, 5 )();
+
+ // 6
+
+ bind(&X::f6, &x, 1, 2, 3, 4, 5, 6 )();
+ bind(&X::f6, ref(x), 1, 2, 3, 4, 5, 6 )();
+
+ bind(&X::g6, &x, 1, 2, 3, 4, 5, 6 )();
+ bind(&X::g6, x, 1, 2, 3, 4, 5, 6 )();
+ bind(&X::g6, ref(x), 1, 2, 3, 4, 5, 6 )();
+
+ // 7
+
+ bind(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::f7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8 )();
+ bind(&X::f8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8 )();
+
+ bind(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8 )();
+ bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8 )();
+ bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8 )();
+
+ BOOST_TEST( x.hash == 23558 );
+}
+
+int main()
+{
+ member_function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,64 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+template<class F, class A1, class R> void test( F f, A1 a1, R r )
+{
+ BOOST_TEST( !f(a1) == r );
+}
+
+bool f( bool v )
+{
+ return v;
+}
+
+int g( int v )
+{
+ return v;
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ //test( !bind( f, true ), 0, !f( true ) );
+ test( bind( f, true ), 0, !f( true ) );
+ //test( !bind( g, _1 ), 5, !g( 5 ) );
+ test( bind( g, _1 ), 5, !g( 5 ) );
+ //test( bind( f, !bind( f, true ) ), 0, f( !f( true ) ) );
+ test( bind( f, bind( f, true ) ), 0, f( !f( true ) ) );
+ //test( bind( f, !bind( f, _1 ) ), true, f( !f( true ) ) );
+ test( bind( f, bind( f, _1 ) ), true, f( !f( true ) ) );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,90 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined( BOOST_MSVC )
+
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+//
+
+long f( long a, long b, long c, long d, long e, long f, long g, long h, long i )
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+template< int I > struct custom_placeholder
+ : boost::mpl::int_<I>
+{
+};
+
+/*
+namespace boost
+{
+
+template< int I > struct is_placeholder< custom_placeholder< I > >
+{
+ enum { value = I };
+};
+
+} // namespace boost
+*/
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::make_argument;
+
+ int const x1 = 1;
+ int const x2 = 2;
+ int const x3 = 3;
+ int const x4 = 4;
+ int const x5 = 5;
+ int const x6 = 6;
+ int const x7 = 7;
+ int const x8 = 8;
+ int const x9 = 9;
+
+ make_argument<custom_placeholder<0> >::type const p1 = {};
+ make_argument<custom_placeholder<1> >::type const p2 = {};
+ make_argument<custom_placeholder<2> >::type const p3 = {};
+ make_argument<custom_placeholder<3> >::type const p4 = {};
+ make_argument<custom_placeholder<4> >::type const p5 = {};
+ make_argument<custom_placeholder<5> >::type const p6 = {};
+ make_argument<custom_placeholder<6> >::type const p7 = {};
+ make_argument<custom_placeholder<7> >::type const p8 = {};
+ make_argument<custom_placeholder<8> >::type const p9 = {};
+
+ BOOST_TEST(
+ bind( f, p1, p2, p3, p4, p5, p6, p7, p8, p9 )
+ ( x1, x2, x3, x4, x5, x6, x7, x8, x9 ) == 987654321L );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,38 @@
+/*==============================================================================
+ Copyright (c) 2009 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/ref.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ int f( int x )
+ {
+ return x;
+ }
+
+ int g( int x ) const
+ {
+ return -x;
+ }
+};
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+ X x;
+
+ BOOST_TEST( bind( &X::f, _1, 1 )( boost::ref( x ) ) == 1 );
+ BOOST_TEST( bind( &X::g, _1, 2 )( boost::cref( x ) ) == -2 );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,103 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/operator.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+int f( int x )
+{
+ return x + x;
+}
+
+int g( int x )
+{
+ return 2 * x;
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::placeholders::_1;
+ using boost::phoenix::placeholders::_2;
+
+ int x = 4;
+ int y = x + x;
+
+ // bind op value
+
+ BOOST_TEST( ( bind( f, _1 ) == y )( x ) );
+ BOOST_TEST( !( ( bind( f, _1 ) != y )( x ) ) );
+
+ BOOST_TEST( !( ( bind( f, _1 ) < y )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) < y + 1 )( x ) );
+
+ BOOST_TEST( !( ( bind( f, _1 ) > y )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) > y - 1 )( x ) );
+
+ BOOST_TEST( !( ( bind( f, _1 ) <= y - 1 )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) <= y )( x ) );
+ BOOST_TEST( ( bind( f, _1 ) <= y + 1 )( x ) );
+
+ BOOST_TEST( !( ( bind( f, _1 ) >= y + 1 )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) >= y )( x ) );
+ BOOST_TEST( ( bind( f, _1 ) >= y - 1 )( x ) );
+
+ // bind op ref
+
+ BOOST_TEST( ( bind( f, _1 ) == ref( y ) )( x ) );
+ BOOST_TEST( !( ( bind( f, _1 ) != ref( y ) )( x ) ) );
+ BOOST_TEST( !( ( bind( f, _1 ) < ref( y ) )( x ) ) );
+ BOOST_TEST( !( ( bind( f, _1 ) > ref( y ) )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) <= ref( y ) )( x ) );
+ BOOST_TEST( ( bind( f, _1 ) >= ref( y ) )( x ) );
+
+ // bind op placeholder
+
+ BOOST_TEST( ( bind( f, _1 ) == _2 )( x, y ) );
+ BOOST_TEST( !( ( bind( f, _1 ) != _2 )( x, y ) ) );
+ BOOST_TEST( !( ( bind( f, _1 ) < _2 )( x, y ) ) );
+ BOOST_TEST( !( ( bind( f, _1 ) > _2 )( x, y ) ) );
+ BOOST_TEST( ( bind( f, _1 ) <= _2 )( x, y ) );
+ BOOST_TEST( ( bind( f, _1 ) >= _2 )( x, y ) );
+
+ // bind op bind
+
+ // important: bind( f, _1 ) and bind( g, _1 ) have the same type
+ BOOST_TEST( ( bind( f, _1 ) == bind( g, _1 ) )( x ) );
+ BOOST_TEST( !( ( bind( f, _1 ) != bind( g, _1 ) )( x ) ) );
+ BOOST_TEST( !( ( bind( f, _1 ) < bind( g, _1 ) )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) <= bind( g, _1 ) )( x ) );
+ BOOST_TEST( !( ( bind( f, _1 ) > bind( g, _1 ) )( x ) ) );
+ BOOST_TEST( ( bind( f, _1 ) >= bind( g, _1 ) )( x ) );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,66 @@
+/*==============================================================================
+ Copyright (c) 2006 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/shared_ptr.hpp>
+
+struct X
+{
+ int v_;
+
+ X( int v ): v_( v )
+ {
+ }
+
+ int f()
+ {
+ return v_;
+ }
+};
+
+struct Y
+{
+ boost::shared_ptr<X> f()
+ {
+ return boost::shared_ptr<X>( new X( 42 ) );
+ }
+};
+
+int main()
+{
+ using boost::phoenix::bind;
+
+ Y y;
+
+ BOOST_TEST( bind( &X::f, bind( &Y::f, &y ) )() == 42 );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,93 @@
+/*==============================================================================
+ Copyright (c) 2006 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined( BOOST_MSVC )
+
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+//
+
+int f( int x )
+{
+ return x;
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+ using boost::phoenix::placeholders::_2;
+ using boost::phoenix::placeholders::_3;
+ using boost::phoenix::placeholders::_4;
+ using boost::phoenix::placeholders::_5;
+ using boost::phoenix::placeholders::_6;
+ using boost::phoenix::placeholders::_7;
+ using boost::phoenix::placeholders::_8;
+ using boost::phoenix::placeholders::_9;
+
+ BOOST_TEST(
+ bind( f, _1 )
+ ( 1 ) == 1 );
+
+ BOOST_TEST(
+ bind( f, _2 )
+ ( 1, 2 ) == 2 );
+
+ BOOST_TEST(
+ bind( f, _3 )
+ ( 1, 2, 3 ) == 3 );
+
+ BOOST_TEST(
+ bind( f, _4 )
+ ( 1, 2, 3, 4 ) == 4 );
+
+ BOOST_TEST(
+ bind( f, _5 )
+ ( 1, 2, 3, 4, 5 ) == 5 );
+
+ BOOST_TEST(
+ bind( f, _6 )
+ ( 1, 2, 3, 4, 5, 6 ) == 6 );
+
+ BOOST_TEST(
+ bind( f, _7 )
+ ( 1, 2, 3, 4, 5, 6, 7 ) == 7 );
+
+ BOOST_TEST(
+ bind( f, _8 )
+ ( 1, 2, 3, 4, 5, 6, 7, 8 ) == 8 );
+
+ BOOST_TEST(
+ bind( f, _9 )
+ ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) == 9 );
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,243 @@
+/*==============================================================================
+ Copyright (c) 2004 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+class X
+{
+private:
+
+ mutable int state_;
+
+public:
+
+ X(): state_(0)
+ {
+ }
+
+ int state() const
+ {
+ return state_;
+ }
+
+ typedef int result_type;
+
+ int operator()() const
+ {
+ return state_ += 17041;
+ }
+
+ int operator()(int x1) const
+ {
+ return state_ += x1;
+ }
+
+ int operator()(int x1, int x2) const
+ {
+ return state_ += x1+x2;
+ }
+
+ int operator()(int x1, int x2, int x3) const
+ {
+ return state_ += x1+x2+x3;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4) const
+ {
+ return state_ += x1+x2+x3+x4;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5) const
+ {
+ return state_ += x1+x2+x3+x4+x5;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6) const
+ {
+ return state_ += x1+x2+x3+x4+x5+x6;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7) const
+ {
+ return state_ += x1+x2+x3+x4+x5+x6+x7;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8) const
+ {
+ return state_ += x1+x2+x3+x4+x5+x6+x7+x8;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9) const
+ {
+ return state_ += x1+x2+x3+x4+x5+x6+x7+x8+x9;
+ }
+};
+
+int f0(int & state_)
+{
+ return state_ += 17041;
+}
+
+int f1(int & state_, int x1)
+{
+ return state_ += x1;
+}
+
+int f2(int & state_, int x1, int x2)
+{
+ return state_ += x1+x2;
+}
+
+int f3(int & state_, int x1, int x2, int x3)
+{
+ return state_ += x1+x2+x3;
+}
+
+int f4(int & state_, int x1, int x2, int x3, int x4)
+{
+ return state_ += x1+x2+x3+x4;
+}
+
+int f5(int & state_, int x1, int x2, int x3, int x4, int x5)
+{
+ return state_ += x1+x2+x3+x4+x5;
+}
+
+int f6(int & state_, int x1, int x2, int x3, int x4, int x5, int x6)
+{
+ return state_ += x1+x2+x3+x4+x5+x6;
+}
+
+int f7(int & state_, int x1, int x2, int x3, int x4, int x5, int x6, int x7)
+{
+ return state_ += x1+x2+x3+x4+x5+x6+x7;
+}
+
+int f8(int & state_, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8)
+{
+ return state_ += x1+x2+x3+x4+x5+x6+x7+x8;
+}
+
+template<class F> void test(F f, int a, int b)
+{
+ BOOST_TEST( f() == a + b );
+ BOOST_TEST( f() == a + 2*b );
+ BOOST_TEST( f() == a + 3*b );
+}
+
+using boost::phoenix::bind;
+using boost::phoenix::ref;
+
+void stateful_function_object_test()
+{
+ test( bind( X() ), 0, 17041 );
+ test( bind( X(), 1 ), 0, 1 );
+ test( bind( X(), 1, 2 ), 0, 1+2 );
+ test( bind( X(), 1, 2, 3 ), 0, 1+2+3 );
+ test( bind( X(), 1, 2, 3, 4 ), 0, 1+2+3+4 );
+ test( bind( X(), 1, 2, 3, 4, 5 ), 0, 1+2+3+4+5 );
+ test( bind( X(), 1, 2, 3, 4, 5, 6 ), 0, 1+2+3+4+5+6 );
+ test( bind( X(), 1, 2, 3, 4, 5, 6, 7 ), 0, 1+2+3+4+5+6+7 );
+ test( bind( X(), 1, 2, 3, 4, 5, 6, 7, 8 ), 0, 1+2+3+4+5+6+7+8 );
+ test( bind( X(), 1, 2, 3, 4, 5, 6, 7, 8, 9 ), 0, 1+2+3+4+5+6+7+8+9 );
+
+ X x;
+
+ int n = x.state();
+
+ test( bind( ref(x) ), n, 17041 );
+ n += 3 * 17041;
+
+ test( bind( ref(x), 1 ), n, 1 );
+ n += 3*1;
+
+ test( bind( ref(x), 1, 2 ), n, 1+2 );
+ n += 3*(1+2);
+
+ test( bind( ref(x), 1, 2, 3 ), n, 1+2+3 );
+ n += 3*(1+2+3);
+
+ test( bind( ref(x), 1, 2, 3, 4 ), n, 1+2+3+4 );
+ n += 3*(1+2+3+4);
+
+ test( bind( ref(x), 1, 2, 3, 4, 5 ), n, 1+2+3+4+5 );
+ n += 3*(1+2+3+4+5);
+
+ test( bind( ref(x), 1, 2, 3, 4, 5, 6 ), n, 1+2+3+4+5+6 );
+ n += 3*(1+2+3+4+5+6);
+
+ test( bind( ref(x), 1, 2, 3, 4, 5, 6, 7 ), n, 1+2+3+4+5+6+7 );
+ n += 3*(1+2+3+4+5+6+7);
+
+ test( bind( ref(x), 1, 2, 3, 4, 5, 6, 7, 8 ), n, 1+2+3+4+5+6+7+8 );
+ n += 3*(1+2+3+4+5+6+7+8);
+
+ test( bind( ref(x), 1, 2, 3, 4, 5, 6, 7, 8, 9 ), n, 1+2+3+4+5+6+7+8+9 );
+ n += 3*(1+2+3+4+5+6+7+8+9);
+
+ BOOST_TEST( x.state() == n );
+}
+
+void stateful_function_test()
+{
+ using boost::phoenix::ref;
+
+ int state = 0;;
+ /*
+ test( bind( f0, ref(state)), state, 17041 );
+ test( bind( f1, ref(state), 1 ), state, 1 );
+ test( bind( f2, ref(state), 1, 2 ), state, 1+2 );
+ test( bind( f3, ref(state), 1, 2, 3 ), state, 1+2+3 );
+ test( bind( f4, ref(state), 1, 2, 3, 4 ), state, 1+2+3+4 );
+ test( bind( f5, ref(state), 1, 2, 3, 4, 5 ), state, 1+2+3+4+5 );
+ test( bind( f6, ref(state), 1, 2, 3, 4, 5, 6 ), state, 1+2+3+4+5+6 );
+ test( bind( f7, ref(state), 1, 2, 3, 4, 5, 6, 7 ), state, 1+2+3+4+5+6+7 );
+ test( bind( f8, ref(state), 1, 2, 3, 4, 5, 6, 7, 8 ), state, 1+2+3+4+5+6+7+8 );
+ */
+ /*
+ test( bind( f0, 0), 0, 17041 );
+ test( bind( f1, 0, 1 ), 0, 1 );
+ test( bind( f2, 0, 1, 2 ), 0, 1+2 );
+ test( bind( f3, 0, 1, 2, 3 ), 0, 1+2+3 );
+ test( bind( f4, 0, 1, 2, 3, 4 ), 0, 1+2+3+4 );
+ test( bind( f5, 0, 1, 2, 3, 4, 5 ), 0, 1+2+3+4+5 );
+ test( bind( f6, 0, 1, 2, 3, 4, 5, 6 ), 0, 1+2+3+4+5+6 );
+ test( bind( f7, 0, 1, 2, 3, 4, 5, 6, 7 ), 0, 1+2+3+4+5+6+7 );
+ test( bind( f8, 0, 1, 2, 3, 4, 5, 6, 7, 8 ), 0, 1+2+3+4+5+6+7+8 );
+ */
+}
+
+int main()
+{
+ stateful_function_object_test();
+ stateful_function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,165 @@
+/*==============================================================================
+ Copyright (c) 2001 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#define BOOST_MEM_FN_ENABLE_STDCALL
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+ mutable unsigned int hash;
+
+ X(): hash(0) {}
+
+ int __stdcall f0() { f1(17); return 0; }
+ int __stdcall g0() const { g1(17); return 0; }
+
+ int __stdcall f1(int a1) { hash = (hash * 17041 + a1) % 32768; return 0; }
+ int __stdcall g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
+
+ int __stdcall f2(int a1, int a2) { f1(a1); f1(a2); return 0; }
+ int __stdcall g2(int a1, int a2) const { g1(a1); g1(a2); return 0; }
+
+ int __stdcall f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); return 0; }
+ int __stdcall g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); return 0; }
+
+ int __stdcall f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); return 0; }
+ int __stdcall g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); return 0; }
+
+ int __stdcall f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); return 0; }
+ int __stdcall g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); return 0; }
+
+ int __stdcall f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
+ int __stdcall g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); return 0; }
+
+ int __stdcall f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); return 0; }
+ int __stdcall g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); return 0; }
+
+ int __stdcall f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); return 0; }
+ int __stdcall g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); return 0; }
+};
+
+void member_function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+
+ X x;
+
+ // 0
+
+ bind(&X::f0, &x)();
+ bind(&X::f0, ref(x))();
+
+ bind(&X::g0, &x)();
+ bind(&X::g0, x)();
+ bind(&X::g0, ref(x))();
+
+ // 1
+
+ bind(&X::f1, &x, 1)();
+ bind(&X::f1, ref(x), 1)();
+
+ bind(&X::g1, &x, 1)();
+ bind(&X::g1, x, 1)();
+ bind(&X::g1, ref(x), 1)();
+
+ // 2
+
+ bind(&X::f2, &x, 1, 2)();
+ bind(&X::f2, ref(x), 1, 2)();
+
+ bind(&X::g2, &x, 1, 2)();
+ bind(&X::g2, x, 1, 2)();
+ bind(&X::g2, ref(x), 1, 2)();
+
+ // 3
+
+ bind(&X::f3, &x, 1, 2, 3)();
+ bind(&X::f3, ref(x), 1, 2, 3)();
+
+ bind(&X::g3, &x, 1, 2, 3)();
+ bind(&X::g3, x, 1, 2, 3)();
+ bind(&X::g3, ref(x), 1, 2, 3)();
+
+ // 4
+
+ bind(&X::f4, &x, 1, 2, 3, 4)();
+ bind(&X::f4, ref(x), 1, 2, 3, 4)();
+
+ bind(&X::g4, &x, 1, 2, 3, 4)();
+ bind(&X::g4, x, 1, 2, 3, 4)();
+ bind(&X::g4, ref(x), 1, 2, 3, 4)();
+
+ // 5
+
+ bind(&X::f5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::f5, ref(x), 1, 2, 3, 4, 5)();
+
+ bind(&X::g5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, ref(x), 1, 2, 3, 4, 5)();
+
+ // 6
+
+ bind(&X::f6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::f6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ bind(&X::g6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ // 7
+
+ bind(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::f7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::f8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ bind(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ BOOST_TEST( x.hash == 23558 );
+}
+
+int main()
+{
+ member_function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,111 @@
+/*==============================================================================
+ Copyright (c) 2001 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#define BOOST_BIND_ENABLE_STDCALL
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+//
+
+long __stdcall f_0()
+{
+ return 17041L;
+}
+
+long __stdcall f_1(long a)
+{
+ return a;
+}
+
+long __stdcall f_2(long a, long b)
+{
+ return a + 10 * b;
+}
+
+long __stdcall f_3(long a, long b, long c)
+{
+ return a + 10 * b + 100 * c;
+}
+
+long __stdcall f_4(long a, long b, long c, long d)
+{
+ return a + 10 * b + 100 * c + 1000 * d;
+}
+
+long __stdcall f_5(long a, long b, long c, long d, long e)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+long __stdcall f_6(long a, long b, long c, long d, long e, long f)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+long __stdcall f_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+long __stdcall f_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+long __stdcall f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+void function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ int const i = 1;
+
+ BOOST_TEST( bind(f_0)(i) == 17041L );
+ BOOST_TEST( bind(f_1, _1)(i) == 1L );
+ BOOST_TEST( bind(f_2, _1, 2)(i) == 21L );
+ BOOST_TEST( bind(f_3, _1, 2, 3)(i) == 321L );
+ BOOST_TEST( bind(f_4, _1, 2, 3, 4)(i) == 4321L );
+ BOOST_TEST( bind(f_5, _1, 2, 3, 4, 5)(i) == 54321L );
+ BOOST_TEST( bind(f_6, _1, 2, 3, 4, 5, 6)(i) == 654321L );
+ BOOST_TEST( bind(f_7, _1, 2, 3, 4, 5, 6, 7)(i) == 7654321L );
+ BOOST_TEST( bind(f_8, _1, 2, 3, 4, 5, 6, 7, 8)(i) == 87654321L );
+ BOOST_TEST( bind(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i) == 987654321L );
+}
+
+int main()
+{
+ function_test();
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,542 @@
+/*==============================================================================
+ Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+ Copyright (c) 2001 David Abrahams
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+//
+
+long f_0()
+{
+ return 17041L;
+}
+
+long f_1(long a)
+{
+ return a;
+}
+
+long f_2(long a, long b)
+{
+ return a + 10 * b;
+}
+
+long f_3(long a, long b, long c)
+{
+ return a + 10 * b + 100 * c;
+}
+
+long f_4(long a, long b, long c, long d)
+{
+ return a + 10 * b + 100 * c + 1000 * d;
+}
+
+long f_5(long a, long b, long c, long d, long e)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+long f_6(long a, long b, long c, long d, long e, long f)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+long f_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+long f_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+long f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+long global_result;
+
+void fv_0()
+{
+ global_result = 17041L;
+}
+
+void fv_1(long a)
+{
+ global_result = a;
+}
+
+void fv_2(long a, long b)
+{
+ global_result = a + 10 * b;
+}
+
+void fv_3(long a, long b, long c)
+{
+ global_result = a + 10 * b + 100 * c;
+}
+
+void fv_4(long a, long b, long c, long d)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d;
+}
+
+void fv_5(long a, long b, long c, long d, long e)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e;
+}
+
+void fv_6(long a, long b, long c, long d, long e, long f)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
+}
+
+void fv_7(long a, long b, long c, long d, long e, long f, long g)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
+}
+
+void fv_8(long a, long b, long c, long d, long e, long f, long g, long h)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
+}
+
+void fv_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
+{
+ global_result = a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
+}
+
+void function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ int const i = 1;
+
+ BOOST_TEST( bind(f_0)(i) == 17041L );
+ BOOST_TEST( bind(f_1, _1)(i) == 1L );
+ BOOST_TEST( bind(f_2, _1, 2)(i) == 21L );
+ BOOST_TEST( bind(f_3, _1, 2, 3)(i) == 321L );
+ BOOST_TEST( bind(f_4, _1, 2, 3, 4)(i) == 4321L );
+ BOOST_TEST( bind(f_5, _1, 2, 3, 4, 5)(i) == 54321L );
+ BOOST_TEST( bind(f_6, _1, 2, 3, 4, 5, 6)(i) == 654321L );
+ BOOST_TEST( bind(f_7, _1, 2, 3, 4, 5, 6, 7)(i) == 7654321L );
+ BOOST_TEST( bind(f_8, _1, 2, 3, 4, 5, 6, 7, 8)(i) == 87654321L );
+ BOOST_TEST( bind(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i) == 987654321L );
+
+ BOOST_TEST( (bind(fv_0)(i), (global_result == 17041L)) );
+ BOOST_TEST( (bind(fv_1, _1)(i), (global_result == 1L)) );
+ BOOST_TEST( (bind(fv_2, _1, 2)(i), (global_result == 21L)) );
+ BOOST_TEST( (bind(fv_3, _1, 2, 3)(i), (global_result == 321L)) );
+ BOOST_TEST( (bind(fv_4, _1, 2, 3, 4)(i), (global_result == 4321L)) );
+ BOOST_TEST( (bind(fv_5, _1, 2, 3, 4, 5)(i), (global_result == 54321L)) );
+ BOOST_TEST( (bind(fv_6, _1, 2, 3, 4, 5, 6)(i), (global_result == 654321L)) );
+ BOOST_TEST( (bind(fv_7, _1, 2, 3, 4, 5, 6, 7)(i), (global_result == 7654321L)) );
+ BOOST_TEST( (bind(fv_8, _1, 2, 3, 4, 5, 6, 7, 8)(i), (global_result == 87654321L)) );
+ BOOST_TEST( (bind(fv_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i), (global_result == 987654321L)) );
+}
+
+//
+
+struct Y
+{
+ template <typename Sig>
+ struct result;
+ template <typename This, typename A0>
+ struct result<This(A0 &)> { typedef short type; };
+ template <typename This, typename A0, typename A1>
+ struct result<This(A0, A1)> { typedef int type; };
+ template <typename This, typename A0, typename A1, typename A2>
+ struct result<This(A0, A1, A2)> { typedef long type; };
+ template <typename This, typename A0, typename A1, typename A2, typename A3>
+ struct result<This(A0, A1, A2, A3)> { typedef void type; };
+
+ short operator()(short & r) const { return ++r; }
+ int operator()(int a, int b) const { return a + 10 * b; }
+ long operator() (long a, long b, long c) const { return a + 10 * b + 100 * c; }
+ void operator() (long a, long b, long c, long d) const { global_result = a + 10 * b + 100 * c + 1000 * d; }
+};
+
+void function_object_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::placeholders::_1;
+
+ short i(6);
+
+ int const k = 3;
+
+ BOOST_TEST( bind(Y(), ref(i))() == 7 );
+ BOOST_TEST( bind(Y(), ref(i))() == 8 );
+ BOOST_TEST( bind(Y(), i, _1)(k) == 38 );
+ BOOST_TEST( bind(Y(), i, _1, 9)(k) == 938 );
+
+#if !defined(__MWERKS__) || (__MWERKS__ > 0x2407) // Fails for this version of the compiler.
+
+ global_result = 0;
+ bind(Y(), i, _1, 9, 4)(k);
+ BOOST_TEST( global_result == 4938 );
+
+#endif
+}
+
+void function_object_test2()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::placeholders::_1;
+
+ short i(6);
+
+ int const k = 3;
+
+ BOOST_TEST( bind(Y(), ref(i))() == 7 );
+ BOOST_TEST( bind(Y(), ref(i))() == 8 );
+ BOOST_TEST( bind(Y(), i, _1)(k) == 38 );
+ BOOST_TEST( bind(Y(), i, _1, 9)(k) == 938 );
+
+ global_result = 0;
+ bind(Y(), i, _1, 9, 4)(k);
+ BOOST_TEST( global_result == 4938 );
+}
+
+//
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+struct Z
+{
+ typedef int result_type;
+ int operator()(int a, int b) const { return a + 10 * b; }
+};
+
+void adaptable_function_object_test()
+{
+ using boost::phoenix::bind;
+ BOOST_TEST( bind(Z(), 7, 4)() == 47 );
+}
+
+#endif
+
+//
+
+struct X
+{
+ mutable unsigned int hash;
+
+ X(): hash(0) {}
+
+ int f0() { f1(17); return 0; }
+ int g0() const { g1(17); return 0; }
+
+ int f1(int a1) { hash = (hash * 17041 + a1) % 32768; return 0; }
+ int g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
+
+ int f2(int a1, int a2) { f1(a1); f1(a2); return 0; }
+ int g2(int a1, int a2) const { g1(a1); g1(a2); return 0; }
+
+ int f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); return 0; }
+ int g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); return 0; }
+
+ int f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); return 0; }
+ int g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); return 0; }
+
+ int f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); return 0; }
+ int g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); return 0; }
+
+ int f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
+ int g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); return 0; }
+
+ int f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); return 0; }
+ int g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); return 0; }
+
+ int f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); return 0; }
+ int g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); return 0; }
+};
+
+struct V
+{
+ mutable unsigned int hash;
+
+ V(): hash(0) {}
+
+ void f0() { f1(17); }
+ void g0() const { g1(17); }
+
+ void f1(int a1) { hash = (hash * 17041 + a1) % 32768; }
+ void g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; }
+
+ void f2(int a1, int a2) { f1(a1); f1(a2); }
+ void g2(int a1, int a2) const { g1(a1); g1(a2); }
+
+ void f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); }
+ void g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); }
+
+ void f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); }
+ void g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); }
+
+ void f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); }
+ void g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); }
+
+ void f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); }
+ void g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); }
+
+ void f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); }
+ void g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); }
+
+ void f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); }
+ void g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); }
+};
+
+void member_function_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+
+ X x;
+
+ // 0
+
+ bind(&X::f0, &x)();
+ bind(&X::f0, ref(x))();
+
+ bind(&X::g0, &x)();
+ bind(&X::g0, x)();
+ bind(&X::g0, ref(x))();
+
+ // 1
+
+ bind(&X::f1, &x, 1)();
+ bind(&X::f1, ref(x), 1)();
+
+ bind(&X::g1, &x, 1)();
+ bind(&X::g1, x, 1)();
+ bind(&X::g1, ref(x), 1)();
+
+ // 2
+
+ bind(&X::f2, &x, 1, 2)();
+ bind(&X::f2, ref(x), 1, 2)();
+
+ bind(&X::g2, &x, 1, 2)();
+ bind(&X::g2, x, 1, 2)();
+ bind(&X::g2, ref(x), 1, 2)();
+
+ // 3
+
+ bind(&X::f3, &x, 1, 2, 3)();
+ bind(&X::f3, ref(x), 1, 2, 3)();
+
+ bind(&X::g3, &x, 1, 2, 3)();
+ bind(&X::g3, x, 1, 2, 3)();
+ bind(&X::g3, ref(x), 1, 2, 3)();
+
+ // 4
+
+ bind(&X::f4, &x, 1, 2, 3, 4)();
+ bind(&X::f4, ref(x), 1, 2, 3, 4)();
+
+ bind(&X::g4, &x, 1, 2, 3, 4)();
+ bind(&X::g4, x, 1, 2, 3, 4)();
+ bind(&X::g4, ref(x), 1, 2, 3, 4)();
+
+ // 5
+
+ bind(&X::f5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::f5, ref(x), 1, 2, 3, 4, 5)();
+
+ bind(&X::g5, &x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, x, 1, 2, 3, 4, 5)();
+ bind(&X::g5, ref(x), 1, 2, 3, 4, 5)();
+
+ // 6
+
+ bind(&X::f6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::f6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ bind(&X::g6, &x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, x, 1, 2, 3, 4, 5, 6)();
+ bind(&X::g6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ // 7
+
+ bind(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::f7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&X::g7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::f8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ bind(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ BOOST_TEST( x.hash == 23558 );
+}
+
+void member_function_void_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::placeholders::_1;
+
+ V v;
+
+ // 0
+
+ bind(&V::f0, &v)();
+ bind(&V::f0, ref(v))();
+
+ bind(&V::g0, &v)();
+ bind(&V::g0, v)();
+ bind(&V::g0, ref(v))();
+
+ // 1
+
+ bind(&V::f1, &v, 1)();
+ bind(&V::f1, ref(v), 1)();
+
+ bind(&V::g1, &v, 1)();
+ bind(&V::g1, v, 1)();
+ bind(&V::g1, ref(v), 1)();
+
+ // 2
+
+ bind(&V::f2, &v, 1, 2)();
+ bind(&V::f2, ref(v), 1, 2)();
+
+ bind(&V::g2, &v, 1, 2)();
+ bind(&V::g2, v, 1, 2)();
+ bind(&V::g2, ref(v), 1, 2)();
+
+ // 3
+
+ bind(&V::f3, &v, 1, 2, 3)();
+ bind(&V::f3, ref(v), 1, 2, 3)();
+
+ bind(&V::g3, &v, 1, 2, 3)();
+ bind(&V::g3, v, 1, 2, 3)();
+ bind(&V::g3, ref(v), 1, 2, 3)();
+
+ // 4
+
+ bind(&V::f4, &v, 1, 2, 3, 4)();
+ bind(&V::f4, ref(v), 1, 2, 3, 4)();
+
+ bind(&V::g4, &v, 1, 2, 3, 4)();
+ bind(&V::g4, v, 1, 2, 3, 4)();
+ bind(&V::g4, ref(v), 1, 2, 3, 4)();
+
+ // 5
+
+ bind(&V::f5, &v, 1, 2, 3, 4, 5)();
+ bind(&V::f5, ref(v), 1, 2, 3, 4, 5)();
+
+ bind(&V::g5, &v, 1, 2, 3, 4, 5)();
+ bind(&V::g5, v, 1, 2, 3, 4, 5)();
+ bind(&V::g5, ref(v), 1, 2, 3, 4, 5)();
+
+ // 6
+
+ bind(&V::f6, &v, 1, 2, 3, 4, 5, 6)();
+ bind(&V::f6, ref(v), 1, 2, 3, 4, 5, 6)();
+
+ bind(&V::g6, &v, 1, 2, 3, 4, 5, 6)();
+ bind(&V::g6, v, 1, 2, 3, 4, 5, 6)();
+ bind(&V::g6, ref(v), 1, 2, 3, 4, 5, 6)();
+
+ // 7
+
+ bind(&V::f7, &v, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&V::f7, ref(v), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind(&V::g7, &v, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&V::g7, v, 1, 2, 3, 4, 5, 6, 7)();
+ bind(&V::g7, ref(v), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind(&V::f8, &v, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&V::f8, ref(v), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ bind(&V::g8, &v, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&V::g8, v, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind(&V::g8, ref(v), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ BOOST_TEST( v.hash == 23558 );
+}
+
+void nested_bind_test()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+ using boost::phoenix::placeholders::_2;
+
+ int const x = 1;
+ int const y = 2;
+
+ BOOST_TEST( bind(f_1, bind(f_1, _1))(x) == 1L );
+ BOOST_TEST( bind(f_1, bind(f_2, _1, _2))(x, y) == 21L );
+ BOOST_TEST( bind(f_2, bind(f_1, _1), bind(f_1, _1))(x) == 11L );
+ BOOST_TEST( bind(f_2, bind(f_1, _1), bind(f_1, _2))(x, y) == 21L );
+ BOOST_TEST( bind(f_1, bind(f_0))() == 17041L );
+
+ BOOST_TEST( (bind(fv_1, bind(f_1, _1))(x), (global_result == 1L)) );
+ BOOST_TEST( (bind(fv_1, bind(f_2, _1, _2))(x, y), (global_result == 21L)) );
+ BOOST_TEST( (bind(fv_2, bind(f_1, _1), bind(f_1, _1))(x), (global_result == 11L)) );
+ BOOST_TEST( (bind(fv_2, bind(f_1, _1), bind(f_1, _2))(x, y), (global_result == 21L)) );
+ BOOST_TEST( (bind(fv_1, bind(f_0))(), (global_result == 17041L)) );
+}
+
+int main()
+{
+ function_test();
+ function_object_test();
+ function_object_test2();
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+ adaptable_function_object_test();
+#endif
+
+ member_function_test();
+ member_function_void_test();
+ nested_bind_test();
+
+ return boost::report_errors();
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,151 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+class X
+{
+private:
+
+ void operator& ();
+ void operator& () const;
+
+public:
+
+ typedef void result_type;
+
+ void operator()()
+ {
+ }
+
+ void operator()() const
+ {
+ }
+
+ void operator()(int)
+ {
+ }
+
+ void operator()(int) const
+ {
+ }
+
+ void operator()(int, int)
+ {
+ }
+
+ void operator()(int, int) const
+ {
+ }
+
+ void operator()(int, int, int)
+ {
+ }
+
+ void operator()(int, int, int) const
+ {
+ }
+
+ void operator()(int, int, int, int)
+ {
+ }
+
+ void operator()(int, int, int, int) const
+ {
+ }
+
+ void operator()(int, int, int, int, int)
+ {
+ }
+
+ void operator()(int, int, int, int, int) const
+ {
+ }
+
+ void operator()(int, int, int, int, int, int)
+ {
+ }
+
+ void operator()(int, int, int, int, int, int) const
+ {
+ }
+
+ void operator()(int, int, int, int, int, int, int)
+ {
+ }
+
+ void operator()(int, int, int, int, int, int, int) const
+ {
+ }
+
+ void operator()(int, int, int, int, int, int, int, int)
+ {
+ }
+
+ void operator()(int, int, int, int, int, int, int, int) const
+ {
+ }
+
+ void operator()(int, int, int, int, int, int, int, int, int)
+ {
+ }
+
+ void operator()(int, int, int, int, int, int, int, int, int) const
+ {
+ }
+};
+
+template<class F> void test_const( F const & f )
+{
+ f();
+}
+
+template<class F> void test( F f )
+{
+ f();
+ test_const( f );
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+
+ test( bind( X() ) );
+ test( bind( X(), 1 ) );
+ test( bind( X(), 1, 2 ) );
+ test( bind( X(), 1, 2, 3 ) );
+ test( bind( X(), 1, 2, 3, 4 ) );
+ test( bind( X(), 1, 2, 3, 4, 5 ) );
+ test( bind( X(), 1, 2, 3, 4, 5, 6 ) );
+ test( bind( X(), 1, 2, 3, 4, 5, 6, 7 ) );
+ test( bind( X(), 1, 2, 3, 4, 5, 6, 7, 8 ) );
+ test( bind( X(), 1, 2, 3, 4, 5, 6, 7, 8, 9 ) );
+
+ return 0;
+}
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_visit_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/boost_bind_compatibility/bind_visit_test.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,76 @@
+/*==============================================================================
+ Copyright (c) 2006 Douglas Gregor <doug.gregor_at_[hidden]>
+ Copyright (c) 2006 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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 <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+# pragma warning(disable: 4786) // identifier truncated in debug info
+# pragma warning(disable: 4710) // function not inlined
+# pragma warning(disable: 4711) // function selected for automatic inline expansion
+# pragma warning(disable: 4514) // unreferenced inline removed
+# pragma warning(disable: 4100) // unreferenced formal parameter (it is referenced!)
+#endif
+
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/visit_each.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+# pragma warning(push, 3)
+#endif
+
+#include <iostream>
+#include <typeinfo>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+# pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct visitor
+{
+ mutable int hash;
+
+ visitor(): hash( 0 )
+ {
+ }
+
+ template<typename T> void operator()( T const & t ) const
+ {
+ std::cout << "visitor::operator()( T ): " << typeid( t ).name() << std::endl;
+ }
+
+ void operator()( int const & t ) const
+ {
+ std::cout << "visitor::operator()( int ): " << t << std::endl;
+ hash = hash * 10 + t;
+ }
+};
+
+int f( int x, int y, int z )
+{
+ return x + y + z;
+}
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ visitor vis;
+
+ boost::visit_each( vis, bind( f, 3, _1, 4 ) );
+
+ BOOST_TEST( vis.hash == 34 );
+
+ return boost::report_errors();
+}
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/dynamic_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/dynamic_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/dynamic_tests.cpp 2010-07-27 06:05:29 EDT (Tue, 27 Jul 2010)
@@ -54,7 +54,7 @@
(clos.real = clos.num * 1e30)();
{ // Third stack frame
- boost::fusion::vector<int, char const*, double> init(-1, "Direct Init ", 3.14);
+ boost::fusion::vector3<int, char const*, double> init(-1, "Direct Init ", 3.14);
dynamic_frame<my_dynamic::self_type> frame(clos, init);
(std::cout << clos.message << clos.num << ", " << clos.real << '\n')();
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