summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/phoenix/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/phoenix/test
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/phoenix/test')
-rw-r--r--src/boost/libs/phoenix/test/Jamfile323
-rw-r--r--src/boost/libs/phoenix/test/algorithm/for_each.cpp51
-rw-r--r--src/boost/libs/phoenix/test/algorithm/for_each2.cpp47
-rw-r--r--src/boost/libs/phoenix/test/algorithm/for_test.cpp55
-rw-r--r--src/boost/libs/phoenix/test/algorithm/for_test2.cpp52
-rw-r--r--src/boost/libs/phoenix/test/algorithm/iteration.cpp57
-rw-r--r--src/boost/libs/phoenix/test/algorithm/querying.cpp286
-rw-r--r--src/boost/libs/phoenix/test/algorithm/querying2.cpp85
-rw-r--r--src/boost/libs/phoenix/test/algorithm/querying_find.cpp96
-rw-r--r--src/boost/libs/phoenix/test/algorithm/querying_find2.cpp103
-rw-r--r--src/boost/libs/phoenix/test/algorithm/transformation1.cpp403
-rw-r--r--src/boost/libs/phoenix/test/algorithm/transformation2.cpp195
-rw-r--r--src/boost/libs/phoenix/test/algorithm/transformation3.cpp187
-rw-r--r--src/boost/libs/phoenix/test/algorithm/transformation4.cpp159
-rw-r--r--src/boost/libs/phoenix/test/bind/bind_function_object_tests.cpp137
-rw-r--r--src/boost/libs/phoenix/test/bind/bind_function_tests.cpp56
-rw-r--r--src/boost/libs/phoenix/test/bind/bind_member_function_tests.cpp77
-rw-r--r--src/boost/libs/phoenix/test/bind/bind_member_variable_tests.cpp111
-rw-r--r--src/boost/libs/phoenix/test/bind/bug5782.cpp23
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/algorithm_test.cpp78
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/bind_tests_advanced.cpp433
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple.cpp170
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple_f_refs.cpp147
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/bll_and_function.cpp62
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/cast_test.cpp107
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/constructor_tests.cpp274
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/control_structures.cpp123
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/exception_test.cpp613
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/extending_rt_traits.cpp389
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/is_instance_of_test.cpp78
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/istreambuf_test.cpp30
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/member_pointer_test.cpp193
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/operator_tests_simple.cpp425
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/phoenix_control_structures.cpp148
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/result_of_tests.cpp315
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/ret_test.cpp54
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/rvalue_test.cpp57
-rw-r--r--src/boost/libs/phoenix/test/bll_compatibility/switch_construct.cpp390
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp77
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp146
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp184
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp165
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm1_test.cpp77
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp74
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp55
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp88
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp52
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp48
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp438
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp165
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp110
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp171
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp79
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp79
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_interoperation_test.cpp142
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp42
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp163
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp61
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp87
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp38
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp102
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp1_test.cpp68
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp2_test.cpp68
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp3_test.cpp68
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp4_test.cpp70
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp5_test.cpp70
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp6_test.cpp71
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp7_test.cpp71
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp75
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp93
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp301
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp167
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp111
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp542
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp151
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_dm_test.cpp73
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_mf_test.cpp171
-rw-r--r--src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_test.cpp139
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests.hpp947
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests10a.cpp73
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests10b.cpp74
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests11a.cpp59
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests11b.cpp60
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests12a.cpp70
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests12b.cpp71
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests1a.cpp49
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests1b.cpp51
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests2a.cpp49
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests2b.cpp50
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests3a.cpp61
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests3b.cpp62
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests4a.cpp50
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests4b.cpp49
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests5a.cpp56
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests5b.cpp55
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests6a.cpp72
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests6b.cpp73
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests7a.cpp59
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests7b.cpp60
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests8a.cpp70
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests8b.cpp71
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests9a.cpp62
-rw-r--r--src/boost/libs/phoenix/test/container/container_tests9b.cpp63
-rw-r--r--src/boost/libs/phoenix/test/core/custom_terminal.cpp13
-rw-r--r--src/boost/libs/phoenix/test/core/intel_test.cpp29
-rw-r--r--src/boost/libs/phoenix/test/core/primitives_tests.cpp85
-rw-r--r--src/boost/libs/phoenix/test/function/adapt_function.cpp84
-rw-r--r--src/boost/libs/phoenix/test/function/function_tests.cpp140
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_argument_tests.cpp53
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_compose_tests.cpp40
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_fold_tests.cpp44
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_list2_tests.cpp42
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_list3_tests.cpp54
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_list_tests.cpp78
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_make_pair_tests.cpp109
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_operator_tests.cpp46
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_ptr_tests.cpp110
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_scan_tests.cpp56
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_templated_struct_tests.cpp68
-rw-r--r--src/boost/libs/phoenix/test/function/lazy_thunk_tests.cpp48
-rw-r--r--src/boost/libs/phoenix/test/include/bind.cpp9
-rw-r--r--src/boost/libs/phoenix/test/include/bind/bind_member_function.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/bind/bind_member_variable.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/core/actor.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/argument.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/arity.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/bug7730.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/core/call.cpp12
-rw-r--r--src/boost/libs/phoenix/test/include/core/debug.cpp13
-rw-r--r--src/boost/libs/phoenix/test/include/core/domain.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/environment.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/expression.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/function_equal.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/is_actor.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/is_nullary.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/limits.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/meta_grammar.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/nothing.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/core/reference.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/terminal.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/core/value.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/function.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/function/function.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/function/lazy_headers.cpp10
-rw-r--r--src/boost/libs/phoenix/test/include/fusion.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/fusion/at.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/fusion_at.cpp11
-rw-r--r--src/boost/libs/phoenix/test/include/object.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/const_cast.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/construct.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/delete.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/dynamic_cast.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/new.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/reinterpret_cast.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/object/static_cast.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/arithmetic.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/bitwise.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/comparison.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/if_else.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/io.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/logical.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/member.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/operator/self.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/phoenix.cpp12
-rw-r--r--src/boost/libs/phoenix/test/include/scope.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/scope/dynamic.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/scope/lambda.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/scope/let.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/scope/local_variable.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/scope/scoped_environment.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/scope/this.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/spirit.cpp10
-rw-r--r--src/boost/libs/phoenix/test/include/spirit_no_specialize.cpp11
-rw-r--r--src/boost/libs/phoenix/test/include/statement.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/statement/do_while.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/statement/for.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/statement/if.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/statement/sequence.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/statement/switch.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/statement/throw.cpp8
-rw-r--r--src/boost/libs/phoenix/test/include/statement/try_catch.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/statement/while.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl/algorithm.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl/algorithm/iteration.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl/algorithm/querying.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl/algorithm/transformation.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl/container.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/stl/container/container.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/support/iterate.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/support/preprocessor/round.cpp7
-rw-r--r--src/boost/libs/phoenix/test/include/version.cpp7
-rw-r--r--src/boost/libs/phoenix/test/object/cast_tests.cpp67
-rw-r--r--src/boost/libs/phoenix/test/object/new_delete_tests.cpp59
-rw-r--r--src/boost/libs/phoenix/test/operator/arithmetic_tests.cpp71
-rw-r--r--src/boost/libs/phoenix/test/operator/bitwise_tests.cpp76
-rw-r--r--src/boost/libs/phoenix/test/operator/comparison_tests.cpp29
-rw-r--r--src/boost/libs/phoenix/test/operator/if_else_tests.cpp36
-rw-r--r--src/boost/libs/phoenix/test/operator/io_tests.cpp61
-rw-r--r--src/boost/libs/phoenix/test/operator/logical_tests.cpp36
-rw-r--r--src/boost/libs/phoenix/test/operator/member.cpp108
-rw-r--r--src/boost/libs/phoenix/test/operator/misc_binary_tests.cpp104
-rw-r--r--src/boost/libs/phoenix/test/operator/self_tests.cpp60
-rw-r--r--src/boost/libs/phoenix/test/operator/unary_tests.cpp65
-rw-r--r--src/boost/libs/phoenix/test/regression/actor_assignment.cpp29
-rw-r--r--src/boost/libs/phoenix/test/regression/bug4853.cpp79
-rw-r--r--src/boost/libs/phoenix/test/regression/bug5626.cpp26
-rw-r--r--src/boost/libs/phoenix/test/regression/bug5824.cpp25
-rw-r--r--src/boost/libs/phoenix/test/regression/bug5875.cpp23
-rw-r--r--src/boost/libs/phoenix/test/regression/bug5968.cpp27
-rw-r--r--src/boost/libs/phoenix/test/regression/bug6040.cpp22
-rw-r--r--src/boost/libs/phoenix/test/regression/bug6268.cpp29
-rw-r--r--src/boost/libs/phoenix/test/regression/bug7165.cpp15
-rw-r--r--src/boost/libs/phoenix/test/regression/bug7166.cpp16
-rw-r--r--src/boost/libs/phoenix/test/regression/bug7624.cpp31
-rw-r--r--src/boost/libs/phoenix/test/regression/from_array.cpp60
-rw-r--r--src/boost/libs/phoenix/test/scope/bug3289.cpp37
-rw-r--r--src/boost/libs/phoenix/test/scope/bug8298.cpp33
-rw-r--r--src/boost/libs/phoenix/test/scope/bug8298f.cpp24
-rw-r--r--src/boost/libs/phoenix/test/scope/bug_000008.cpp105
-rw-r--r--src/boost/libs/phoenix/test/scope/dynamic_tests.cpp75
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests1.cpp23
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests10.cpp35
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests11.cpp33
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests12.cpp26
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests13.cpp28
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests14.cpp34
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests15.cpp34
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests16.cpp25
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests17.cpp27
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests18.cpp36
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests19.cpp41
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests2.cpp25
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests20.cpp29
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests21.cpp29
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests22.cpp30
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests23.cpp28
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests3.cpp25
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests4.cpp33
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests5.cpp27
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests6.cpp27
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests7.cpp34
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests8.cpp23
-rw-r--r--src/boost/libs/phoenix/test/scope/lambda_tests9.cpp25
-rw-r--r--src/boost/libs/phoenix/test/scope/let_tests.cpp204
-rw-r--r--src/boost/libs/phoenix/test/scope/let_tests_113.cpp204
-rw-r--r--src/boost/libs/phoenix/test/scope/let_tests_113a.cpp192
-rw-r--r--src/boost/libs/phoenix/test/scope/let_tests_157.cpp194
-rw-r--r--src/boost/libs/phoenix/test/scope/let_tests_157a.cpp191
-rw-r--r--src/boost/libs/phoenix/test/scope/let_tests_rest.cpp192
-rw-r--r--src/boost/libs/phoenix/test/scope/more_lambda_tests.cpp48
-rw-r--r--src/boost/libs/phoenix/test/scope/more_let_tests.cpp156
-rw-r--r--src/boost/libs/phoenix/test/scope/more_let_tests1.cpp136
-rw-r--r--src/boost/libs/phoenix/test/scope/more_let_tests2.cpp125
-rw-r--r--src/boost/libs/phoenix/test/scope/more_let_tests2a.cpp126
-rw-r--r--src/boost/libs/phoenix/test/scope/more_let_tests2b.cpp136
-rw-r--r--src/boost/libs/phoenix/test/scope/this.cpp124
-rw-r--r--src/boost/libs/phoenix/test/statement/bug5715.cpp37
-rw-r--r--src/boost/libs/phoenix/test/statement/exceptions.cpp194
-rw-r--r--src/boost/libs/phoenix/test/statement/if_tests.cpp70
-rw-r--r--src/boost/libs/phoenix/test/statement/loops_tests.cpp85
-rw-r--r--src/boost/libs/phoenix/test/statement/switch_tests.cpp76
-rw-r--r--src/boost/libs/phoenix/test/stdlib/cmath.cpp31
265 files changed, 20240 insertions, 0 deletions
diff --git a/src/boost/libs/phoenix/test/Jamfile b/src/boost/libs/phoenix/test/Jamfile
new file mode 100644
index 000000000..835e482c7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/Jamfile
@@ -0,0 +1,323 @@
+#==============================================================================
+# Copyright (c) 2003-2006 Joel de Guzman
+# Copyright (c) 2014-2015 John Fletcher
+#
+# Use, modification and distribution is subject to 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)
+#==============================================================================
+
+# bring in rules for testing
+import testing ;
+import os ;
+
+import ../../config/checks/config : requires ;
+
+if [ os.environ CI ]
+{
+ CI_DEFINES = <define>CI_SKIP_KNOWN_FAILURE=1 ;
+ CI_DEFINES += <define>RUNNING_ON_TRAVIS=1 ; # for backward compatibility
+ CI_DEFINES += <define>RUNNING_ON_APPVEYOR=1 ; # for backward compatibility
+}
+
+project
+ : requirements
+ <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
+ <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
+ <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
+ <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
+ $(CI_DEFINES)
+ ;
+
+local multi-threading = <library>/boost/thread
+ <threading>multi <define>BOOST_ALL_NO_LIB=1 ;
+
+test-suite phoenix_core :
+ [ run core/custom_terminal.cpp ]
+ [ run core/intel_test.cpp ]
+ [ run core/primitives_tests.cpp ]
+ ;
+
+test-suite phoenix_stdlib :
+ [ run stdlib/cmath.cpp ]
+ ;
+
+test-suite phoenix_operator :
+ [ run operator/arithmetic_tests.cpp ]
+ [ run operator/bitwise_tests.cpp ]
+ [ run operator/comparison_tests.cpp ]
+ [ run operator/if_else_tests.cpp ]
+ [ run operator/io_tests.cpp ]
+ [ run operator/logical_tests.cpp ]
+ [ run operator/misc_binary_tests.cpp ]
+ [ run operator/self_tests.cpp ]
+ [ run operator/unary_tests.cpp ]
+ [ run operator/member.cpp ]
+ ;
+
+test-suite phoenix_object :
+ [ run object/cast_tests.cpp ]
+ [ run object/new_delete_tests.cpp ]
+ ;
+
+test-suite phoenix_function :
+ [ run function/adapt_function.cpp ]
+ [ run function/function_tests.cpp ]
+ [ run function/lazy_argument_tests.cpp ]
+# [ run function/lazy_compose_tests.cpp ]
+# [ run function/lazy_fold_tests.cpp ]
+ [ run function/lazy_list_tests.cpp ]
+ [ run function/lazy_list2_tests.cpp ]
+ [ run function/lazy_list3_tests.cpp ]
+ [ run function/lazy_make_pair_tests.cpp ]
+# [ run function/lazy_ptr_tests.cpp ]
+# [ run function/lazy_scan_tests.cpp ]
+ [ run function/lazy_templated_struct_tests.cpp ]
+# [ run function/lazy_thunk_tests.cpp ]
+ [ run function/lazy_operator_tests.cpp ]
+ ;
+
+test-suite phoenix_bind :
+ [ run bind/bind_function_tests.cpp ]
+ [ run bind/bind_function_object_tests.cpp ]
+ [ run bind/bind_member_function_tests.cpp ]
+ [ run bind/bind_member_variable_tests.cpp ]
+ [ run bind/bug5782.cpp ]
+ ;
+
+test-suite phoenix_statement :
+ [ run statement/if_tests.cpp ]
+ [ run statement/loops_tests.cpp ]
+ [ run statement/switch_tests.cpp ]
+ [ run statement/exceptions.cpp ]
+ [ run statement/bug5715.cpp ]
+ ;
+
+test-suite phoenix_container :
+ [ run container/container_tests1a.cpp ]
+ [ run container/container_tests1b.cpp ]
+ [ run container/container_tests2a.cpp ]
+ [ run container/container_tests2b.cpp ]
+ [ run container/container_tests3a.cpp ]
+ [ run container/container_tests3b.cpp ]
+ [ run container/container_tests4a.cpp ]
+ [ run container/container_tests4b.cpp ]
+ [ run container/container_tests5a.cpp ]
+ [ run container/container_tests5b.cpp ]
+ [ run container/container_tests6a.cpp ]
+ [ run container/container_tests6b.cpp ]
+ [ run container/container_tests7a.cpp ]
+ [ run container/container_tests7b.cpp ]
+ [ run container/container_tests8a.cpp ]
+ [ run container/container_tests8b.cpp : : : [ requires cxx11_hdr_unordered_map ] ]
+ [ run container/container_tests9a.cpp : : : [ requires cxx11_hdr_unordered_map ] ]
+ [ run container/container_tests9b.cpp : : : [ requires cxx11_hdr_unordered_map ] ]
+ [ run container/container_tests10a.cpp : : : [ requires cxx11_hdr_unordered_map ] ]
+ [ run container/container_tests10b.cpp : : : [ requires cxx11_hdr_unordered_map ] ]
+ [ run container/container_tests11a.cpp : : : [ requires cxx11_hdr_unordered_set ] ]
+ [ run container/container_tests11b.cpp : : : [ requires cxx11_hdr_unordered_set ] ]
+ [ run container/container_tests12a.cpp : : : [ requires cxx11_hdr_unordered_set ] ]
+ [ run container/container_tests12b.cpp : : : [ requires cxx11_hdr_unordered_set ] ]
+ ;
+
+test-suite phoenix_scope :
+ [ run scope/lambda_tests1.cpp ]
+ [ run scope/lambda_tests2.cpp ]
+ [ run scope/lambda_tests3.cpp ]
+ [ run scope/lambda_tests4.cpp ]
+ [ run scope/lambda_tests5.cpp ]
+ [ run scope/lambda_tests6.cpp ]
+ [ run scope/lambda_tests7.cpp ]
+ [ run scope/lambda_tests8.cpp ]
+ [ run scope/lambda_tests9.cpp ]
+ [ run scope/lambda_tests10.cpp ]
+ [ run scope/lambda_tests11.cpp ]
+ [ run scope/lambda_tests12.cpp ]
+ [ run scope/lambda_tests13.cpp ]
+ [ run scope/lambda_tests14.cpp ]
+ [ run scope/lambda_tests15.cpp ]
+ [ run scope/lambda_tests16.cpp ]
+ [ run scope/lambda_tests17.cpp ]
+ [ run scope/lambda_tests18.cpp ]
+ [ run scope/lambda_tests19.cpp ]
+ [ run scope/lambda_tests20.cpp ]
+ [ run scope/lambda_tests21.cpp ]
+ [ run scope/lambda_tests22.cpp ]
+ [ run scope/lambda_tests23.cpp ]
+ [ run scope/let_tests.cpp ]
+ [ run scope/let_tests_113.cpp ]
+# [ run scope/let_tests_113a.cpp ]
+ [ run scope/let_tests_157.cpp ]
+# [ run scope/let_tests_157a.cpp ]
+ [ run scope/let_tests_rest.cpp ]
+ [ run scope/more_lambda_tests.cpp ]
+ [ run scope/more_let_tests.cpp ]
+# [ run scope/more_let_tests1.cpp ]
+# [ run scope/more_let_tests2a.cpp ]
+# [ run scope/more_let_tests2b.cpp ]
+ [ run scope/dynamic_tests.cpp ]
+ [ run scope/bug3289.cpp ]
+ [ run scope/bug8298.cpp ]
+ [ compile-fail scope/bug8298f.cpp ]
+ [ run scope/bug_000008.cpp : : : $(multi-threading) ]
+ ;
+
+test-suite phoenix_algorithm :
+ [ run algorithm/for_each.cpp ]
+ [ run algorithm/for_each2.cpp ]
+ [ run algorithm/for_test.cpp ]
+ [ run algorithm/for_test2.cpp ]
+ [ run algorithm/iteration.cpp ]
+ [ run algorithm/transformation1.cpp ]
+ [ run algorithm/transformation2.cpp ]
+ [ run algorithm/transformation3.cpp ]
+ [ run algorithm/transformation4.cpp ]
+ [ run algorithm/querying.cpp ]
+ [ run algorithm/querying_find.cpp ]
+ [ run algorithm/querying2.cpp ]
+ [ run algorithm/querying_find2.cpp ]
+ ;
+
+test-suite phoenix_boost_bind_compatibility :
+ [ run boost_bind_compatibility/bind_and_or_test.cpp ]
+ [ run boost_bind_compatibility/bind_const_test.cpp ]
+ [ run boost_bind_compatibility/bind_cv_test.cpp ]
+ [ run boost_bind_compatibility/bind_dm_test.cpp ]
+# [ run boost_bind_compatibility/bind_dm1_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 ]
+ [ run boost_bind_compatibility/bind_eq2_test.cpp ]
+ [ run boost_bind_compatibility/bind_eq3_test.cpp ]
+ [ run boost_bind_compatibility/bind_fn2_test.cpp ]
+ [ run boost_bind_compatibility/bind_function_test.cpp ]
+ [ run boost_bind_compatibility/bind_interoperation_test.cpp ]
+ [ run boost_bind_compatibility/bind_mf2_test.cpp ]
+ [ run boost_bind_compatibility/bind_not_test.cpp ]
+ [ run boost_bind_compatibility/bind_placeholder_test.cpp ]
+ [ 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_rv_sp1_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp2_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp3_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp4_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp5_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp6_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp7_test.cpp ]
+ [ run boost_bind_compatibility/bind_stateful_test.cpp ]
+ [ run boost_bind_compatibility/bind_test.cpp ]
+# [ run boost_bind_compatibility/bind_void_dm_test.cpp ]
+ ;
+
+test-suite phoenix_bll_compatibility :
+ [ run bll_compatibility/algorithm_test.cpp ]
+ [ run bll_compatibility/bind_tests_advanced.cpp ]
+# [ run bll_compatibility/bind_tests_simple.cpp ]
+# [ run bll_compatibility/bind_tests_simple_f_refs.cpp ]
+# [ run bll_compatibility/bll_and_function.cpp ]
+# [ run bll_compatibility/cast_test.cpp ]
+# [ run bll_compatibility/constructor_tests.cpp ]
+# [ run bll_compatibility/control_structures.cpp ]
+# [ run bll_compatibility/exception_test.cpp ]
+# [ run bll_compatibility/extending_rt_traits.cpp ]
+# [ run bll_compatibility/is_instance_of_test.cpp ]
+# [ run bll_compatibility/istreambuf_test.cpp ]
+# [ run bll_compatibility/member_pointer_test.cpp ]
+# [ run bll_compatibility/operator_tests_simple.cpp ]
+# [ run bll_compatibility/phoenix_control_structures.cpp ]
+# [ run bll_compatibility/result_of_tests.cpp ]
+# [ run bll_compatibility/ret_test.cpp ]
+# [ run bll_compatibility/rvalue_test.cpp ]
+# [ run bll_compatibility/switch_construct.cpp ]
+ ;
+
+test-suite phoenix_regression :
+ [ run regression/bug4853.cpp ]
+ [ run regression/bug5626.cpp ]
+ [ run regression/bug5824.cpp ]
+ # [ run regression/bug5875.cpp ]
+ [ run regression/bug5968.cpp ]
+ [ run regression/bug6040.cpp ]
+ [ run regression/bug6268.cpp ]
+ [ run regression/bug7165.cpp ]
+ [ compile-fail regression/bug7166.cpp ]
+ [ run regression/bug7624.cpp ]
+ [ compile regression/from_array.cpp ]
+ [ run regression/actor_assignment.cpp ]
+ ;
+
+test-suite phoenix_include :
+ [ run include/bind.cpp ]
+ [ run include/core.cpp ]
+ [ run include/function.cpp ]
+ [ run include/fusion.cpp ]
+ [ run include/object.cpp ]
+ [ run include/operator.cpp ]
+ [ run include/scope.cpp ]
+# [ run include/spirit.cpp ]
+# [ run include/spirit_no_specialize.cpp ]
+ [ run include/statement.cpp ]
+ [ run include/stl.cpp ]
+ [ run include/version.cpp ]
+ [ run include/bind/bind_member_function.cpp ]
+ [ run include/bind/bind_member_variable.cpp ]
+ [ run include/core/actor.cpp ]
+ [ run include/core/argument.cpp ]
+ [ run include/core/arity.cpp ]
+ [ run include/core/debug.cpp ]
+ [ run include/core/domain.cpp ]
+ [ run include/core/environment.cpp ]
+ [ run include/core/expression.cpp ]
+ [ run include/core/function_equal.cpp ]
+ [ run include/core/is_actor.cpp ]
+ [ run include/core/is_nullary.cpp ]
+ [ run include/core/limits.cpp ]
+ [ run include/core/meta_grammar.cpp ]
+ [ run include/core/nothing.cpp ]
+ [ run include/core/reference.cpp ]
+ [ run include/core/terminal.cpp ]
+ # [ run include/core/bug7730.cpp ]
+ [ run include/core/value.cpp ]
+ [ run include/function/function.cpp : : : : function_function ]
+ [ run include/function/lazy_headers.cpp ]
+ [ run include/fusion/at.cpp ]
+ [ run include/object/const_cast.cpp ]
+ [ run include/object/construct.cpp ]
+ [ run include/object/delete.cpp ]
+ [ run include/object/dynamic_cast.cpp ]
+ [ run include/object/new.cpp ]
+ [ run include/object/reinterpret_cast.cpp ]
+ [ run include/object/static_cast.cpp ]
+ [ run include/operator/arithmetic.cpp ]
+ [ run include/operator/bitwise.cpp ]
+ [ run include/operator/comparison.cpp ]
+ [ run include/operator/if_else.cpp ]
+ [ run include/operator/io.cpp ]
+ [ run include/operator/logical.cpp ]
+ [ run include/operator/member.cpp : : : : operator_member ]
+ [ run include/operator/self.cpp ]
+ [ run include/scope/dynamic.cpp ]
+ [ run include/scope/lambda.cpp ]
+ [ run include/scope/let.cpp ]
+ [ run include/scope/local_variable.cpp ]
+ [ run include/scope/scoped_environment.cpp ]
+ [ run include/scope/this.cpp ]
+ [ run include/statement/do_while.cpp ]
+ [ run include/statement/for.cpp ]
+ [ run include/statement/if.cpp ]
+ [ run include/statement/sequence.cpp ]
+ [ run include/statement/switch.cpp ]
+ [ run include/statement/throw.cpp ]
+ [ run include/statement/try_catch.cpp ]
+ [ run include/statement/while.cpp ]
+ [ run include/stl/algorithm.cpp ]
+ [ run include/stl/container.cpp ]
+ [ run include/stl/container/container.cpp : : : : container_container ]
+ [ run include/stl/algorithm/iteration.cpp : : : : include_iteration ]
+ [ run include/stl/algorithm/querying.cpp : : : : include_querying ]
+ [ run include/stl/algorithm/transformation.cpp ]
+ [ run include/support/iterate.cpp ]
+ [ run include/support/preprocessor/round.cpp ]
+ ;
diff --git a/src/boost/libs/phoenix/test/algorithm/for_each.cpp b/src/boost/libs/phoenix/test/algorithm/for_each.cpp
new file mode 100644
index 000000000..82e5ca6f1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/for_each.cpp
@@ -0,0 +1,51 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <functional>
+#include <vector>
+#include <string>
+#include <sstream>
+
+namespace
+{
+
+ void for_each_test()
+ {
+ using boost::phoenix::for_each;
+ using boost::phoenix::lambda;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::arg1;
+
+ std::vector<int> v;
+ for (int i = 1; i < 10; i++)
+ v.push_back(i);
+
+ std::string test_str("(123456789)");
+ std::ostringstream out;
+ (
+ out << val("("),
+ for_each(arg1, lambda[out << arg1]),
+ out << val(")")
+ )(v);
+ BOOST_TEST(out.str() == test_str);
+ return;
+ }
+
+}
+
+int main()
+{
+ for_each_test();
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/for_each2.cpp b/src/boost/libs/phoenix/test/algorithm/for_each2.cpp
new file mode 100644
index 000000000..66aac15cc
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/for_each2.cpp
@@ -0,0 +1,47 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014-2015 John Fletcher
+
+ 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.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <functional>
+#include <vector>
+#include <string>
+#include <sstream>
+
+namespace
+{
+
+ void for_each_test()
+ {
+ return;
+ using boost::phoenix::for_each;
+ using boost::phoenix::lambda;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::arg1;
+
+ std::vector<int> v;
+ for (int i = 1; i < 10; i++)
+ v.push_back(i);
+
+ int x = 0;
+ for_each(arg1, lambda[ref(x) += arg1])(v);
+ BOOST_TEST(x == 45);
+ return;
+ }
+
+}
+
+int main()
+{
+ for_each_test();
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/for_test.cpp b/src/boost/libs/phoenix/test/algorithm/for_test.cpp
new file mode 100644
index 000000000..c57d610c1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/for_test.cpp
@@ -0,0 +1,55 @@
+ /*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <functional>
+#include <vector>
+#include <string>
+#include <sstream>
+#include <boost/typeof/std/ostream.hpp>
+
+namespace
+{
+
+ void for_test()
+ {
+ using boost::phoenix::for_;
+ using boost::phoenix::val;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::arg1;
+
+ std::vector<int> v;
+ for (int i = 1; i < 10; i++)
+ v.push_back(i);
+
+ std::string test_str("(123456789)");
+ std::ostringstream out;
+ int iii;
+ int size = v.size();
+ (
+ out << val("("),
+ for_(ref(iii) = 0, ref(iii) < size, ++ref(iii) )
+ [ out << arg1[ref(iii)] ],
+ out << val(")")
+ )(v);
+ BOOST_TEST(out.str() == test_str);
+ return;
+ }
+
+}
+
+int main()
+{
+ for_test();
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/for_test2.cpp b/src/boost/libs/phoenix/test/algorithm/for_test2.cpp
new file mode 100644
index 000000000..9fa9baec6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/for_test2.cpp
@@ -0,0 +1,52 @@
+ /*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014-2015 John Fletcher
+
+ 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.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <functional>
+#include <vector>
+#include <string>
+#include <sstream>
+#include <boost/typeof/std/ostream.hpp>
+
+namespace
+{
+
+ void for_test()
+ {
+ using boost::phoenix::for_;
+ using boost::phoenix::val;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::arg1;
+
+ std::vector<int> v;
+ for (int i = 1; i < 10; i++)
+ v.push_back(i);
+
+ //std::string test_str("(123456789)");
+ //std::ostringstream out;
+ int iii;
+ int x = 0;
+ int size = v.size();
+ for_(ref(iii) = 0, ref(iii) < size, ++ref(iii) )
+ [ ref(x) += arg1[ref(iii)] ] (v);
+ BOOST_TEST(x == 45);
+ return;
+ }
+
+}
+
+int main()
+{
+ for_test();
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/iteration.cpp b/src/boost/libs/phoenix/test/algorithm/iteration.cpp
new file mode 100644
index 000000000..a809b5eb1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/iteration.cpp
@@ -0,0 +1,57 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+
+ 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/stl/algorithm/iteration.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <functional>
+
+namespace
+{
+ struct for_each_tester
+ {
+ int value_;
+ for_each_tester() : value_(0) { }
+ void operator()(
+ int& i)
+ {
+ value_ += i++;
+ return;
+ }
+ };
+
+ void for_each_test()
+ {
+ using boost::phoenix::for_each;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(for_each(arg1, for_each_tester())(array).value_ == 6);
+ BOOST_TEST(array[0] == 2);
+ BOOST_TEST(array[1] == 3);
+ BOOST_TEST(array[2] == 4);
+ return;
+ }
+
+ void accumulate_test()
+ {
+ using boost::phoenix::accumulate;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(accumulate(arg1, 0)(array) == 6);
+ BOOST_TEST(boost::phoenix::accumulate(arg1, 0, std::minus<int>())(array) == -6);
+ return;
+ }
+}
+
+int main()
+{
+ for_each_test();
+ accumulate_test();
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/querying.cpp b/src/boost/libs/phoenix/test/algorithm/querying.cpp
new file mode 100644
index 000000000..02704d3ca
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/querying.cpp
@@ -0,0 +1,286 @@
+/*=============================================================================
+ Copyright (c) 2005 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2007 Hartmut Kaiser
+ Copyright (c) 2015 John Fletcher
+
+ 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/stl/algorithm/querying.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/assign/list_of.hpp>
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_PHOENIX_HAS_HASH
+#define _GLIBCXX_PERMIT_BACKWARD_HASH
+#include BOOST_PHOENIX_HASH_SET_HEADER
+#include BOOST_PHOENIX_HASH_MAP_HEADER
+#endif
+
+#include <set>
+#include <map>
+#include <functional>
+
+namespace
+{
+ struct even
+ {
+ bool operator()(const int i) const
+ {
+ return i % 2 == 0;
+ }
+ };
+
+ struct mod_2_comparison
+ {
+ bool operator()(
+ const int lhs,
+ const int rhs)
+ {
+ return lhs % 2 == rhs % 2;
+ }
+ };
+
+ void find_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(boost::phoenix::find(arg1,2)(array) == array + 1);
+
+ std::set<int> s(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(s) == s.find(2));
+
+#if !(defined(BOOST_MSVC) && (BOOST_MSVC >= 1900))
+ std::map<int, int> m = boost::assign::map_list_of(0, 1)(2, 3)(4, 5);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(m) == m.find(2));
+#endif
+
+#ifdef BOOST_PHOENIX_HAS_HASH
+
+ BOOST_PHOENIX_HASH_NAMESPACE::hash_set<int> hs(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(hs) == hs.find(2));
+
+ BOOST_PHOENIX_HASH_NAMESPACE::hash_map<int, int> hm = boost::assign::map_list_of(0, 1)(2, 3)(4, 5);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(hm) == hm.find(2));
+
+#endif
+
+ return;
+ }
+
+
+ void find_if_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(boost::phoenix::find_if(arg1, even())(array) == array + 1);
+ return;
+ }
+
+ void find_end_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3,1,2,3,1};
+ int pattern[] = {1,2,3};
+ BOOST_TEST(boost::phoenix::find_end(arg1, arg2)(array, pattern) == array + 3);
+ int pattern2[] = {5,6,5};
+ BOOST_TEST(boost::phoenix::find_end(arg1, arg2, mod_2_comparison())(array, pattern2) == array + 3);
+ return;
+ }
+
+ void find_first_of_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int search_for[] = {2,3,4};
+ BOOST_TEST(boost::phoenix::find_first_of(arg1, arg2)(array, search_for) == array + 1);
+
+ int search_for2[] = {0};
+ BOOST_TEST(boost::phoenix::find_first_of(arg1, arg2, mod_2_comparison())(array, search_for2) == array + 1);
+ return;
+ }
+
+ void adjacent_find_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {0,1,3,4,4};
+ BOOST_TEST(boost::phoenix::adjacent_find(arg1)(array) == array + 3);
+ BOOST_TEST(boost::phoenix::adjacent_find(arg1, mod_2_comparison())(array) == array + 1);
+ return;
+ }
+
+ void count_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,1,0,1,1};
+ BOOST_TEST(boost::phoenix::count(arg1, 1)(array) == 4);
+ return;
+ }
+
+ void count_if_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3,4,5};
+ BOOST_TEST(boost::phoenix::count_if(arg1, even())(array) == 2);
+ return;
+ }
+
+ void distance_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,1,0,1,1};
+ BOOST_TEST(boost::phoenix::distance(arg1)(array) == 5);
+ return;
+ }
+
+ void mismatch_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3,4,5};
+ int search[] = {1,2,4};
+
+ BOOST_TEST(
+ boost::phoenix::mismatch(arg1, arg2)(array, search) ==
+ std::make_pair(array + 2, search + 2));
+ int search2[] = {1,2,1,1};
+ BOOST_TEST(
+ boost::phoenix::mismatch(arg1, arg2, mod_2_comparison())(array, search2)
+ == std::make_pair(array + 3, search2 + 3));
+
+ return;
+ }
+
+ void equal_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[] = {1,2,3};
+ int array3[] = {1,2,4};
+ BOOST_TEST(
+ boost::phoenix::equal(arg1, arg2)(array, array2));
+ BOOST_TEST(
+ !boost::phoenix::equal(arg1, arg2)(array, array3));
+
+ BOOST_TEST(
+ boost::phoenix::equal(arg1, arg2, mod_2_comparison())(array, array2));
+ BOOST_TEST(
+ !boost::phoenix::equal(arg1, arg2, mod_2_comparison())(array, array3));
+ return;
+ }
+
+ void search_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3,1,2,3};
+ int pattern[] = {2,3};
+ BOOST_TEST(
+ boost::phoenix::search(arg1, arg2)(array, pattern) == array + 1);
+ int pattern2[] = {1,1};
+ BOOST_TEST(
+ boost::phoenix::search(arg1, arg2, mod_2_comparison())(array, pattern2) == array + 2);
+ return;
+ }
+
+ void lower_bound_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ const std::set<int> test_set(array, array + 3);
+ BOOST_TEST(boost::phoenix::lower_bound(arg1, 2)(array) == array + 1);
+ BOOST_TEST(boost::phoenix::lower_bound(arg1, 2)(test_set) == test_set.lower_bound(2));
+
+ int array2[] = {3,2,1};
+ const std::set<int, std::greater<int> > test_set2(array2, array2 + 3);
+ BOOST_TEST(boost::phoenix::lower_bound(arg1, 2, std::greater<int>())(array2) ==
+ array2 + 1);
+ BOOST_TEST(boost::phoenix::lower_bound(arg1, 2, std::greater<int>())(test_set2) ==
+ test_set2.lower_bound(2));
+ return;
+ }
+
+ void upper_bound_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ const std::set<int> test_set(array, array + 3);
+ BOOST_TEST(upper_bound(arg1, 2)(array) == array + 2);
+ BOOST_TEST(upper_bound(arg1, 2)(test_set) == test_set.upper_bound(2));
+
+ int array2[] = {3,2,1};
+ const std::set<int, std::greater<int> > test_set2(array2, array2 + 3);
+ BOOST_TEST(boost::phoenix::upper_bound(arg1, 2, std::greater<int>())(array2) ==
+ array2 + 2);
+ BOOST_TEST(boost::phoenix::upper_bound(arg1, 2, std::greater<int>())(test_set2) ==
+ test_set2.upper_bound(2));
+ return;
+ }
+
+ void equal_range_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,2,3};
+ const std::set<int> test_set(array, array + 4);
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2)(array).first ==
+ array + 1);
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2)(array).second ==
+ array + 3);
+
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2)(test_set).first ==
+ test_set.equal_range(2).first);
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2)(test_set).second ==
+ test_set.equal_range(2).second);
+
+ int array2[] = {3,2,2,1};
+ const std::set<int, std::greater<int> > test_set2(array2, array2 + 4);
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2, std::greater<int>())(array2).first ==
+ array2 + 1);
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2, std::greater<int>())(array2).second ==
+ array2 + 3);
+
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2, std::greater<int>())(test_set2).first ==
+ test_set2.equal_range(2).first);
+ BOOST_TEST(boost::phoenix::equal_range(arg1, 2, std::greater<int>())(test_set2).second ==
+ test_set2.equal_range(2).second);
+
+ return;
+ }
+
+ void binary_search_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(boost::phoenix::binary_search(arg1, 2)(array));
+ BOOST_TEST(!boost::phoenix::binary_search(arg1, 4)(array));
+ return;
+ }
+
+}
+
+int main()
+{
+ find_test();
+ find_if_test();
+ find_end_test();
+ find_first_of_test();
+ adjacent_find_test();
+ count_test();
+ count_if_test();
+ distance_test();
+ mismatch_test();
+ equal_test();
+ search_test();
+ lower_bound_test();
+ upper_bound_test();
+ equal_range_test();
+ binary_search_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/querying2.cpp b/src/boost/libs/phoenix/test/algorithm/querying2.cpp
new file mode 100644
index 000000000..c6641186d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/querying2.cpp
@@ -0,0 +1,85 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+
+ 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/stl/algorithm/querying.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <boost/range.hpp>
+
+#include <functional>
+
+namespace
+{
+ void includes_test()
+ {
+ using boost::phoenix::includes;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[] = {1,2};
+ BOOST_TEST(includes(arg1, arg2)(array, array2));
+ boost::iterator_range<int*> rng(array + 1, array + 3);
+ BOOST_TEST(!includes(arg1, arg2)(rng, array2));
+
+ int array3[] = {3,2,1};
+ int array4[] = {2,1};
+ BOOST_TEST(boost::phoenix::includes(arg1, arg2, std::greater<int>())(array3, array4));
+ boost::iterator_range<int*> rng2(array3, array3 + 2);
+ BOOST_TEST(!boost::phoenix::includes(arg1, arg2, std::greater<int>())(rng2, array4));
+ return;
+ }
+
+ void min_element_test()
+ {
+ using boost::phoenix::min_element;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,3,2};
+ BOOST_TEST(min_element(arg1)(array) == array);
+ BOOST_TEST(boost::phoenix::min_element(arg1, std::greater<int>())(array) == array + 1);
+ return;
+ }
+
+ void max_element_test()
+ {
+ using boost::phoenix::max_element;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,3,2};
+ BOOST_TEST(max_element(arg1)(array) == array + 1);
+ BOOST_TEST(boost::phoenix::max_element(arg1, std::greater<int>())(array) == array);
+ return;
+ }
+
+ void lexicographical_compare_test()
+ {
+ using boost::phoenix::lexicographical_compare;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[] = {1,2,4};
+
+ BOOST_TEST(lexicographical_compare(arg1, arg2)(array, array2));
+ BOOST_TEST(!lexicographical_compare(arg1, arg2)(array2, array));
+ BOOST_TEST(!lexicographical_compare(arg1, arg2)(array, array));
+
+ BOOST_TEST(!boost::phoenix::lexicographical_compare(arg1, arg2, std::greater<int>())(array, array2));
+ BOOST_TEST(boost::phoenix::lexicographical_compare(arg1, arg2, std::greater<int>())(array2, array));
+ BOOST_TEST(!boost::phoenix::lexicographical_compare(arg1, arg2, std::greater<int>())(array, array));
+
+ return;
+ }
+}
+
+int main()
+{
+ includes_test();
+ min_element_test();
+ max_element_test();
+ lexicographical_compare_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/querying_find.cpp b/src/boost/libs/phoenix/test/algorithm/querying_find.cpp
new file mode 100644
index 000000000..99707aa21
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/querying_find.cpp
@@ -0,0 +1,96 @@
+/*=============================================================================
+ Copyright (c) 2005 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2007 Hartmut Kaiser
+ Copyright (c) 2015 John Fletcher
+
+ 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/stl/algorithm/querying.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/assign/list_of.hpp>
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_PHOENIX_HAS_HASH
+#include BOOST_PHOENIX_HASH_SET_HEADER
+#include BOOST_PHOENIX_HASH_MAP_HEADER
+#endif
+#ifdef BOOST_PHOENIX_HAS_UNORDERED_SET_AND_MAP
+#include BOOST_PHOENIX_UNORDERED_SET_HEADER
+#include BOOST_PHOENIX_UNORDERED_MAP_HEADER
+#endif
+
+#include <set>
+#include <map>
+#include <functional>
+
+namespace
+{
+ struct even
+ {
+ bool operator()(const int i) const
+ {
+ return i % 2 == 0;
+ }
+ };
+
+ struct mod_2_comparison
+ {
+ bool operator()(
+ const int lhs,
+ const int rhs)
+ {
+ return lhs % 2 == rhs % 2;
+ }
+ };
+
+ void find_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(boost::phoenix::find(arg1,2)(array) == array + 1);
+
+ std::set<int> s(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(s) == s.find(2));
+
+ //#if !(defined(BOOST_MSVC) && (BOOST_MSVC >= 1900))
+ //std::map<int, int> m = boost::assign::map_list_of(0, 1)(2, 3)(4, 5).to_container(m);
+ std::map<int, int> m = boost::assign::map_list_of(0, 1)(2, 3)(4, 5).
+ convert_to_container<std::map<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(m) == m.find(2));
+ //#endif
+
+#ifdef BOOST_PHOENIX_HAS_HASH
+
+ BOOST_PHOENIX_HASH_NAMESPACE::hash_set<int> hs(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(hs) == hs.find(2));
+
+ BOOST_PHOENIX_HASH_NAMESPACE::hash_map<int, int> hm = boost::assign::map_list_of(0, 1)(2, 3)(4, 5).
+ convert_to_container<BOOST_PHOENIX_HASH_NAMESPACE::hash_map<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(hm) == hm.find(2));
+
+#endif
+#ifdef BOOST_PHOENIX_HAS_UNORDERED_SET_AND_MAP
+
+ std::unordered_set<int> us(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(us) == us.find(2));
+
+ std::unordered_map<int, int> um = boost::assign::map_list_of(0, 1)(2, 3)(4, 5).
+ convert_to_container<std::unordered_map<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(um) == um.find(2));
+
+#endif
+ return;
+ }
+}
+
+int main()
+{
+ find_test();
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/algorithm/querying_find2.cpp b/src/boost/libs/phoenix/test/algorithm/querying_find2.cpp
new file mode 100644
index 000000000..a7d2bcdb2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/querying_find2.cpp
@@ -0,0 +1,103 @@
+/*=============================================================================
+ Copyright (c) 2005 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2007 Hartmut Kaiser
+ Copyright (c) 2015 John Fletcher
+
+ 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/config.hpp>
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/querying.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/assign/list_of.hpp>
+
+#include <set>
+#include <map>
+#include <functional>
+
+#ifdef BOOST_PHOENIX_HAS_HASH
+#include BOOST_PHOENIX_HASH_SET_HEADER
+#include BOOST_PHOENIX_HASH_MAP_HEADER
+#endif
+#ifdef BOOST_PHOENIX_HAS_UNORDERED_SET_AND_MAP
+#include BOOST_PHOENIX_UNORDERED_SET_HEADER
+#include BOOST_PHOENIX_UNORDERED_MAP_HEADER
+#endif
+
+namespace
+{
+ struct even
+ {
+ bool operator()(const int i) const
+ {
+ return i % 2 == 0;
+ }
+ };
+
+ struct mod_2_comparison
+ {
+ bool operator()(
+ const int lhs,
+ const int rhs)
+ {
+ return lhs % 2 == rhs % 2;
+ }
+ };
+
+ void find_test()
+ {
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ BOOST_TEST(boost::phoenix::find(arg1,2)(array) == array + 1);
+
+ std::set<int> s(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(s) == s.find(2));
+
+ std::map<int, int> m = boost::assign::map_list_of(0, 1)(2, 3)(4, 5).
+ convert_to_container<std::map<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(m) == m.find(2));
+
+#ifdef BOOST_PHOENIX_HAS_HASH
+
+ BOOST_PHOENIX_HASH_NAMESPACE::hash_set<int> hs(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(hs) == hs.find(2));
+
+ BOOST_PHOENIX_HASH_NAMESPACE::hash_map<int, int> hm = boost::assign::map_list_of(0, 1)(2, 3)(4, 5).
+ convert_to_container<BOOST_PHOENIX_HASH_NAMESPACE::hash_map<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(hm) == hm.find(2));
+
+#endif
+#ifdef BOOST_PHOENIX_HAS_UNORDERED_SET_AND_MAP
+
+ std::unordered_set<int> us(array, array + 3);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(us) == us.find(2));
+
+ int marray[] = {1,1,2,3,3};
+ std::unordered_multiset<int> ums(marray, marray + 5);
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(ums) == ums.find(2));
+
+ std::unordered_map<int, int> um =
+ boost::assign::map_list_of(0, 1)(2, 3)(4, 5).
+ convert_to_container<std::unordered_map<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(um) == um.find(2));
+
+ std::unordered_multimap<int, int> umm =
+ boost::assign::map_list_of(0, 1)(2, 3)(4, 5)(4, 6).
+ convert_to_container<std::unordered_multimap<int, int> >();
+ BOOST_TEST(boost::phoenix::find(arg1, 2)(umm) == umm.find(2));
+
+#endif
+ return;
+ }
+}
+
+int main()
+{
+ find_test();
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/algorithm/transformation1.cpp b/src/boost/libs/phoenix/test/algorithm/transformation1.cpp
new file mode 100644
index 000000000..657b9fbe9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/transformation1.cpp
@@ -0,0 +1,403 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+
+ 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/stl/algorithm/transformation.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <functional>
+#include <list>
+
+namespace
+{
+ struct even
+ {
+ bool operator()(const int i) const
+ {
+ return i % 2 == 0;
+ }
+ };
+
+ struct mod_2_comparison
+ {
+ bool operator()(
+ const int lhs,
+ const int rhs)
+ {
+ return lhs % 2 == rhs % 2;
+ }
+ };
+
+ void swap_test()
+ {
+ using boost::phoenix::swap;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ int a = 123;
+ int b = 456;
+ swap(ref(a), ref(b))();
+ BOOST_TEST(a == 456 && b == 123);
+ swap(ref(a), _1)(b);
+ BOOST_TEST(a == 123 && b == 456);
+ swap(_1, _2)(a, b);
+ BOOST_TEST(a == 456 && b == 123);
+ return;
+ }
+
+ void copy_test()
+ {
+ using boost::phoenix::copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int output[4];
+ BOOST_TEST(
+ copy(arg1, arg2)(array, output) == output + 3);
+ BOOST_TEST(output[0] == 1);
+ BOOST_TEST(output[1] == 2);
+ BOOST_TEST(output[2] == 3);
+ return;
+ }
+
+ void copy_backward_test()
+ {
+ using boost::phoenix::copy_backward;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int output[4];
+ int* output_end = output + 3;
+ BOOST_TEST(
+ copy_backward(arg1, arg2)(array, output_end) == output);
+ BOOST_TEST(output[0] == 1);
+ BOOST_TEST(output[1] == 2);
+ BOOST_TEST(output[2] == 3);
+ return;
+ }
+
+ struct increment
+ {
+ int operator()(
+ int i) const
+ {
+ return i+1;
+ }
+ };
+
+ void transform_test()
+ {
+ using boost::phoenix::transform;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ int array[] = {1,2,3};
+ BOOST_TEST(
+ transform(arg1, arg2, increment())(array, array) ==
+ array + 3);
+ BOOST_TEST(array[0] == 2);
+ BOOST_TEST(array[1] == 3);
+ BOOST_TEST(array[2] == 4);
+
+ int array2[] = {1,2,3};
+ BOOST_TEST(
+ boost::phoenix::transform(arg1, arg2, arg3, std::plus<int>())(array, array2, array) ==
+ array +3);
+ BOOST_TEST(array[0] == 2 + 1);
+ BOOST_TEST(array[1] == 3 + 2);
+ BOOST_TEST(array[2] == 4 + 3);
+ return;
+ }
+
+ void replace_test()
+ {
+ using boost::phoenix::replace;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ replace(arg1,2,4)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 4);
+ BOOST_TEST(array[2] == 3);
+ return;
+ }
+
+ void replace_if_test()
+ {
+ using boost::phoenix::replace_if;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ replace_if(arg1, even(), 4)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 4);
+ BOOST_TEST(array[2] == 3);
+ return;
+ }
+
+ void replace_copy_test()
+ {
+ using boost::phoenix::replace_copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int input[] = {1,2,3};
+ int output[3];
+ replace_copy(arg1, arg2, 2, 4)(input, output);
+ BOOST_TEST(output[0] == 1);
+ BOOST_TEST(output[1] == 4);
+ BOOST_TEST(output[2] == 3);
+ return;
+ }
+
+ void replace_copy_if_test()
+ {
+ using boost::phoenix::replace_copy_if;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int input[] = {1,2,3};
+ int output[3];
+ replace_copy_if(arg1, arg2, even(), 4)(input, output);
+ BOOST_TEST(output[0] == 1);
+ BOOST_TEST(output[1] == 4);
+ BOOST_TEST(output[2] == 3);
+ return;
+ }
+
+ void fill_test()
+ {
+ using boost::phoenix::fill;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {0,0,0};
+ fill(arg1, 1)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 1);
+ BOOST_TEST(array[2] == 1);
+ return;
+ }
+
+ void fill_n_test()
+ {
+ using boost::phoenix::fill_n;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {0,0,0};
+ fill_n(arg1, 2, 1)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 1);
+ BOOST_TEST(array[2] == 0);
+ return;
+ }
+
+ class int_seq
+ {
+ public:
+ int_seq() : val_(0) { }
+
+ int operator()()
+ {
+ return val_++;
+ }
+ private:
+ int val_;
+ };
+
+ void generate_test()
+ {
+ using boost::phoenix::generate;
+ using boost::phoenix::arg_names::arg1;
+ int array[3];
+ generate(arg1, int_seq())(array);
+ BOOST_TEST(array[0] == 0);
+ BOOST_TEST(array[1] == 1);
+ BOOST_TEST(array[2] == 2);
+ return;
+ }
+
+ void generate_n_test()
+ {
+ using boost::phoenix::generate_n;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {0,0,1};
+ generate_n(arg1, 2, int_seq())(array);
+ BOOST_TEST(array[0] == 0);
+ BOOST_TEST(array[1] == 1);
+ BOOST_TEST(array[2] == 1);
+ return;
+ }
+
+
+ void remove_test()
+ {
+ using boost::phoenix::remove;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ std::list<int> test_list(array, array + 3);
+ BOOST_TEST(boost::phoenix::remove(arg1, 2)(array) == array + 2);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 3);
+ BOOST_TEST(boost::phoenix::remove(arg1, 2)(test_list) == test_list.end());
+ std::list<int>::const_iterator it(test_list.begin());
+ BOOST_TEST(*it++ == 1);
+ BOOST_TEST(*it++ == 3);
+ return;
+ }
+
+ void remove_if_test()
+ {
+ using boost::phoenix::remove_if;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ std::list<int> test_list(array, array + 3);
+ BOOST_TEST(boost::phoenix::remove_if(arg1, even())(array) == array + 2);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 3);
+ BOOST_TEST(boost::phoenix::remove_if(arg1, even())(test_list) == test_list.end());
+ std::list<int>::const_iterator it(test_list.begin());
+ BOOST_TEST(*it++ == 1);
+ BOOST_TEST(*it++ == 3);
+ return;
+ }
+
+ void remove_copy_test()
+ {
+ using boost::phoenix::remove_copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[2];
+ BOOST_TEST(boost::phoenix::remove_copy(arg1, arg2, 2)(array, array2) == array2 + 2);
+ BOOST_TEST(array2[0] == 1);
+ BOOST_TEST(array2[1] == 3);
+ return;
+ }
+
+ void remove_copy_if_test()
+ {
+ using boost::phoenix::remove_copy_if;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[2];
+ BOOST_TEST(boost::phoenix::remove_copy_if(arg1, arg2, even())(array, array2) == array2 + 2);
+ BOOST_TEST(array2[0] == 1);
+ BOOST_TEST(array2[1] == 3);
+ return;
+ }
+
+ void unique_test()
+ {
+ using boost::phoenix::unique;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,2,3};
+ std::list<int> test_list(array, array + 4);
+ BOOST_TEST(unique(arg1)(array) == array + 3);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 3);
+
+ BOOST_TEST(unique(arg1)(test_list) == test_list.end());
+ std::list<int>::const_iterator it(test_list.begin());
+ BOOST_TEST(*it++ == 1);
+ BOOST_TEST(*it++ == 2);
+ BOOST_TEST(*it++ == 3);
+
+ int array2[] = {1,3,2};
+ std::list<int> test_list2(array2, array2 + 3);
+ BOOST_TEST(unique(arg1, mod_2_comparison())(array2) == array2 + 2);
+ BOOST_TEST(array2[0] == 1);
+ BOOST_TEST(array2[1] == 2);
+
+ BOOST_TEST(unique(arg1, mod_2_comparison())(test_list2) == test_list2.end());
+ std::list<int>::const_iterator jt(test_list2.begin());
+ BOOST_TEST(*jt++ == 1);
+ BOOST_TEST(*jt++ == 2);
+
+ return;
+ }
+
+ void unique_copy_test()
+ {
+ using boost::phoenix::unique_copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,2,3};
+ int out[3];
+ BOOST_TEST(unique_copy(arg1, arg2)(array, out) == out + 3);
+ BOOST_TEST(out[0] == 1);
+ BOOST_TEST(out[1] == 2);
+ BOOST_TEST(out[2] == 3);
+
+ int array2[] = {1,3,2};
+ int out2[2];
+ BOOST_TEST(unique_copy(arg1, arg2, mod_2_comparison())(array2, out2) == out2 + 2);
+ BOOST_TEST(out2[0] == 1);
+ BOOST_TEST(out2[1] == 2);
+
+ return;
+ }
+
+ void reverse_test()
+ {
+ using boost::phoenix::reverse;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ std::list<int> test_list(array, array + 3);
+ reverse(arg1)(array);
+ BOOST_TEST(array[0] == 3);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 1);
+
+ reverse(arg1)(test_list);
+ std::list<int>::iterator it(test_list.begin());
+ BOOST_TEST(*it++ == 3);
+ BOOST_TEST(*it++ == 2);
+ BOOST_TEST(*it++ == 1);
+ return;
+ }
+
+ void reverse_copy_test()
+ {
+ using boost::phoenix::reverse_copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[3];
+ reverse_copy(arg1, arg2)(array, array2);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 3);
+
+ BOOST_TEST(array2[0] == 3);
+ BOOST_TEST(array2[1] == 2);
+ BOOST_TEST(array2[2] == 1);
+
+ return;
+ }
+}
+
+int main()
+{
+ swap_test();
+ copy_test();
+ copy_backward_test();
+ transform_test();
+ replace_test();
+ replace_if_test();
+ replace_copy_test();
+ replace_copy_if_test();
+ fill_test();
+ fill_n_test();
+ generate_test();
+ generate_n_test();
+ remove_test();
+ remove_if_test();
+ remove_copy_test();
+ remove_copy_if_test();
+ unique_test();
+ unique_copy_test();
+ reverse_test();
+ reverse_copy_test();
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/transformation2.cpp b/src/boost/libs/phoenix/test/algorithm/transformation2.cpp
new file mode 100644
index 000000000..e22d57bd9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/transformation2.cpp
@@ -0,0 +1,195 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+
+ 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 <functional>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/transformation.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <list>
+
+namespace
+{
+ struct even
+ {
+ bool operator()(const int i) const
+ {
+ return i % 2 == 0;
+ }
+ };
+
+ void rotate_test()
+ {
+ using boost::phoenix::rotate;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ rotate(arg1, array + 1)(array);
+ std::cout << array[0] << array[1] << array[2] << std::endl;
+ BOOST_TEST(array[0] == 2);
+ BOOST_TEST(array[1] == 3);
+ BOOST_TEST(array[2] == 1);
+
+ return;
+ }
+
+ void rotate_copy_test()
+ {
+ using boost::phoenix::rotate_copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int array2[3];
+ rotate_copy(arg1, array + 1, arg2)(array, array2);
+ BOOST_TEST(array2[0] == 2);
+ BOOST_TEST(array2[1] == 3);
+ BOOST_TEST(array2[2] == 1);
+
+ return;
+ }
+
+ void random_shuffle_test()
+ {
+#ifndef BOOST_NO_CXX98_RANDOM_SHUFFLE
+ using boost::phoenix::random_shuffle;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ random_shuffle(arg1)(array);
+ const int first = array[0];
+ BOOST_TEST(first == 1 || first == 2 || first == 3);
+ const int second = array[1];
+ BOOST_TEST(second == 1 || second == 2 || second == 3);
+ BOOST_TEST(first != second);
+ const int third = array[2];
+ BOOST_TEST(third == 1 || third == 2 || third == 3);
+ BOOST_TEST(first != third && second != third);
+ return;
+#endif
+ }
+
+ void partition_test()
+ {
+ using boost::phoenix::partition;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ int* const end = partition(arg1, even())(array);
+ BOOST_TEST(end == array + 1);
+ BOOST_TEST(array[0] % 2 == 0);
+ BOOST_TEST(array[1] % 2 != 0);
+ BOOST_TEST(array[2] % 2 != 0);
+ return;
+ }
+
+ void stable_partition_test()
+ {
+ using boost::phoenix::stable_partition;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ int* const end = stable_partition(arg1, even())(array);
+ BOOST_TEST(end == array + 1);
+ BOOST_TEST(array[0] == 2);
+ BOOST_TEST(array[1] == 1);
+ BOOST_TEST(array[2] == 3);
+ return;
+ }
+
+ void sort_test()
+ {
+ using boost::phoenix::sort;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {3,1,2};
+ std::list<int> test_list(array, array + 3);
+ sort(arg1)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 3);
+
+ sort(arg1)(test_list);
+ std::list<int>::const_iterator it(test_list.begin());
+ BOOST_TEST(*it++ == 1);
+ BOOST_TEST(*it++ == 2);
+ BOOST_TEST(*it++ == 3);
+
+ boost::phoenix::sort(arg1, std::greater<int>())(array);
+ BOOST_TEST(array[0] == 3);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 1);
+
+ boost::phoenix::sort(arg1, std::greater<int>())(test_list);
+ std::list<int>::const_iterator jt(test_list.begin());
+ BOOST_TEST(*jt++ == 3);
+ BOOST_TEST(*jt++ == 2);
+ BOOST_TEST(*jt++ == 1);
+
+ return;
+ }
+
+ void stable_sort_test()
+ {
+ using boost::phoenix::stable_sort;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {3,1,2};
+ stable_sort(arg1)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 3);
+
+ boost::phoenix::stable_sort(arg1, std::greater<int>())(array);
+ BOOST_TEST(array[0] == 3);
+ BOOST_TEST(array[1] == 2);
+ BOOST_TEST(array[2] == 1);
+
+ return;
+ }
+
+ void partial_sort_test()
+ {
+ using boost::phoenix::partial_sort;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {2,4,1,3};
+ partial_sort(arg1, array + 2)(array);
+ BOOST_TEST(array[0] == 1);
+ BOOST_TEST(array[1] == 2);
+
+ boost::phoenix::partial_sort(arg1, array + 2, std::greater<int>())(array);
+ BOOST_TEST(array[0] == 4);
+ BOOST_TEST(array[1] == 3);
+ return;
+ }
+
+ void partial_sort_copy_test()
+ {
+ using boost::phoenix::partial_sort_copy;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {2,4,1,3};
+ int array2[2];
+ partial_sort_copy(arg1, arg2)(array, array2);
+ BOOST_TEST(array2[0] == 1);
+ BOOST_TEST(array2[1] == 2);
+
+ boost::phoenix::partial_sort_copy(arg1, arg2, std::greater<int>())(array, array2);
+ BOOST_TEST(array2[0] == 4);
+ BOOST_TEST(array2[1] == 3);
+
+ return;
+ }
+}
+
+int main()
+{
+ rotate_test();
+ rotate_copy_test();
+ random_shuffle_test();
+ partition_test();
+ stable_partition_test();
+ sort_test();
+ stable_sort_test();
+ partial_sort_test();
+ partial_sort_copy_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/transformation3.cpp b/src/boost/libs/phoenix/test/algorithm/transformation3.cpp
new file mode 100644
index 000000000..8a1787480
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/transformation3.cpp
@@ -0,0 +1,187 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+
+ 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 <functional>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/algorithm/transformation.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <list>
+
+namespace
+{
+ void nth_element_test()
+ {
+ using boost::phoenix::nth_element;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {5,1,4,3,2};
+ nth_element(arg1, array + 2)(array);
+ BOOST_TEST(array[0] < 3);
+ BOOST_TEST(array[1] < 3);
+ BOOST_TEST(array[2] == 3);
+ BOOST_TEST(array[3] > 3);
+ BOOST_TEST(array[4] > 3);
+
+ boost::phoenix::nth_element(arg1, array + 2, std::greater<int>())(array);
+ BOOST_TEST(array[0] > 3);
+ BOOST_TEST(array[1] > 3);
+ BOOST_TEST(array[2] == 3);
+ BOOST_TEST(array[3] < 3);
+ BOOST_TEST(array[4] < 3);
+
+ return;
+ }
+
+ void merge_test()
+ {
+ using boost::phoenix::merge;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ int array[] = {1,2,3};
+ int array2[] = {2,3,4};
+ int output[6];
+
+ BOOST_TEST(merge(arg1, arg2, arg3)(array, array2, output) == output + 6);
+ int expected_result[] = {1,2,2,3,3,4};
+ BOOST_TEST(std::equal(output, output + 6, expected_result));
+
+ int array3[] = {5,4,3};
+ int array4[] = {3,2,1};
+ int output2[6];
+ BOOST_TEST(boost::phoenix::merge(arg1, arg2, arg3, std::greater<int>())(array3, array4, output2) ==
+ output2 + 6);
+ int expected_result2[] = {5,4,3,3,2,1};
+ BOOST_TEST(std::equal(output2, output2 + 6, expected_result2));
+ return;
+ }
+
+ void inplace_merge_test()
+ {
+ using boost::phoenix::inplace_merge;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3,2,3,4};
+ inplace_merge(arg1, array + 3)(array);
+ int expected_result[] = {1,2,2,3,3,4};
+ BOOST_TEST(std::equal(array, array + 6, expected_result));
+
+ int array2[] = {5,4,3,4,3,2};
+ boost::phoenix::inplace_merge(arg1, array2 + 3, std::greater<int>())(array2);
+ int expected_result2[] = {5,4,4,3,3,2};
+ BOOST_TEST(std::equal(array2, array2 + 6, expected_result2));
+ return;
+ }
+
+ void set_union_test()
+ {
+ using boost::phoenix::set_union;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ int array[] = {1,2,3};
+ int array2[] = {2,3,4};
+ int output[4];
+ BOOST_TEST(set_union(arg1, arg2, arg3)(array, array2, output) == output + 4);
+ int expected_result[] = {1,2,3,4};
+ BOOST_TEST(std::equal(output, output + 4, expected_result));
+
+ int array3[] = {3,2,1};
+ int array4[] = {4,3,2};
+ int output2[4];
+ BOOST_TEST(boost::phoenix::set_union(arg1, arg2, arg3, std::greater<int>())
+ (array3, array4, output2) ==
+ output2 + 4);
+ int expected_result2[] = {4,3,2,1};
+ BOOST_TEST(std::equal(output2, output2 + 4, expected_result2));
+ return;
+ }
+
+ void set_intersection_test()
+ {
+ using boost::phoenix::set_intersection;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ int array[] = {1,2,3};
+ int array2[] = {2,3,4};
+ int output[2];
+ BOOST_TEST(set_intersection(arg1, arg2, arg3)(array, array2, output) == output + 2);
+ int expected_result[] = {2,3};
+ BOOST_TEST(std::equal(output, output + 2, expected_result));
+
+ int array3[] = {3,2,1};
+ int array4[] = {4,3,2};
+ int output2[2];
+ BOOST_TEST(boost::phoenix::set_intersection(arg1, arg2, arg3, std::greater<int>())
+ (array3, array4, output2) ==
+ output2 + 2);
+ int expected_result2[] = {3,2};
+ BOOST_TEST(std::equal(output2, output2 + 2, expected_result2));
+ return;
+ }
+
+ void set_difference_test()
+ {
+ using boost::phoenix::set_difference;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ int array[] = {1,2,3};
+ int array2[] = {2,3,4};
+ int output[1];
+ BOOST_TEST(set_difference(arg1, arg2, arg3)(array, array2, output) == output + 1);
+ int expected_result[] = {1};
+ BOOST_TEST(std::equal(output, output + 1, expected_result));
+
+ int array3[] = {3,2,1};
+ int array4[] = {4,3,2};
+ int output2[1];
+ BOOST_TEST(boost::phoenix::set_difference(arg1, arg2, arg3, std::greater<int>())
+ (array3, array4, output2) ==
+ output2 + 1);
+ int expected_result2[] = {1};
+ BOOST_TEST(std::equal(output2, output2 + 1, expected_result2));
+ return;
+ }
+
+ void set_symmetric_difference_test()
+ {
+ using boost::phoenix::set_symmetric_difference;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ int array[] = {1,2,3};
+ int array2[] = {2,3,4};
+ int output[2];
+ BOOST_TEST(set_symmetric_difference(arg1, arg2, arg3)(array, array2, output) == output + 2);
+ int expected_result[] = {1,4};
+ BOOST_TEST(std::equal(output, output + 2, expected_result));
+
+ int array3[] = {3,2,1};
+ int array4[] = {4,3,2};
+ int output2[2];
+ BOOST_TEST(boost::phoenix::set_symmetric_difference(arg1, arg2, arg3, std::greater<int>())
+ (array3, array4, output2) ==
+ output2 + 2);
+ int expected_result2[] = {4,1};
+ BOOST_TEST(std::equal(output2, output2 + 2, expected_result2));
+ return;
+ }
+}
+
+int main()
+{
+ nth_element_test();
+ merge_test();
+ inplace_merge_test();
+ set_union_test();
+ set_intersection_test();
+ set_difference_test();
+ set_symmetric_difference_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/algorithm/transformation4.cpp b/src/boost/libs/phoenix/test/algorithm/transformation4.cpp
new file mode 100644
index 000000000..f278a4c6f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/algorithm/transformation4.cpp
@@ -0,0 +1,159 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+
+ 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/stl/algorithm/transformation.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <vector>
+#include <functional>
+#include <algorithm>
+
+namespace
+{
+ void heap_test()
+ {
+ using boost::phoenix::make_heap;
+ using boost::phoenix::pop_heap;
+ using boost::phoenix::push_heap;
+ using boost::phoenix::sort_heap;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2,3};
+ std::vector<int> vec(array, array + 3);
+ boost::phoenix::make_heap(arg1)(vec);
+ vec.push_back(5);
+ boost::phoenix::push_heap(arg1)(vec);
+ vec.push_back(4);
+ boost::phoenix::push_heap(arg1)(vec);
+ boost::phoenix::pop_heap(arg1)(vec);
+ BOOST_TEST(vec.back() == 5);
+ vec.pop_back();
+ boost::phoenix::sort_heap(arg1)(vec);
+ int expected_result[] = {1,2,3,4};
+ BOOST_TEST(std::equal(vec.begin(), vec.end(), expected_result));
+
+ int array2[] = {3,2,1};
+ std::vector<int> vec2(array2, array2 + 3);
+ boost::phoenix::make_heap(arg1, std::greater<int>())(vec2);
+ vec2.push_back(5);
+ boost::phoenix::push_heap(arg1, std::greater<int>())(vec2);
+ vec2.push_back(4);
+ boost::phoenix::push_heap(arg1, std::greater<int>())(vec2);
+ boost::phoenix::pop_heap(arg1, std::greater<int>())(vec2);
+ BOOST_TEST(vec2.back() == 1);
+ vec2.pop_back();
+ boost::phoenix::sort_heap(arg1, std::greater<int>())(vec2);
+ int expected_result2[] = {5,4,3,2};
+ BOOST_TEST(std::equal(vec2.begin(), vec2.end(), expected_result2));
+
+ return;
+ }
+
+ void next_permutation_test()
+ {
+ using boost::phoenix::next_permutation;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {1,2};
+ int expected_result[] = {2,1};
+ int expected_result2[] = {1,2};
+
+ BOOST_TEST(next_permutation(arg1)(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result));
+ BOOST_TEST(!next_permutation(arg1)(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result2));
+
+ std::reverse(array, array + 2);
+ BOOST_TEST(boost::phoenix::next_permutation(arg1, std::greater<int>())(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result2));
+ BOOST_TEST(!boost::phoenix::next_permutation(arg1, std::greater<int>())(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result));
+ return;
+ }
+
+ void prev_permutation_test()
+ {
+ using boost::phoenix::prev_permutation;
+ using boost::phoenix::arg_names::arg1;
+ int array[] = {2,1};
+ int expected_result[] = {1,2};
+ int expected_result2[] = {2,1};
+
+ BOOST_TEST(prev_permutation(arg1)(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result));
+ BOOST_TEST(!prev_permutation(arg1)(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result2));
+
+ std::reverse(array, array + 2);
+ BOOST_TEST(boost::phoenix::prev_permutation(arg1, std::greater<int>())(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result2));
+ BOOST_TEST(!boost::phoenix::prev_permutation(arg1, std::greater<int>())(array));
+ BOOST_TEST(std::equal(array, array + 2, expected_result));
+ return;
+ }
+
+ void inner_product_test()
+ {
+ using boost::phoenix::inner_product;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int lhs[] = {1,2,3};
+ int rhs[] = {4,5,6};
+ BOOST_TEST(inner_product(arg1, arg2, 0)
+ (lhs, rhs) == 1*4 + 2*5 + 3*6);
+ BOOST_TEST(boost::phoenix::inner_product(arg1, arg2, 1, std::multiplies<int>(), std::minus<int>())
+ (lhs, rhs) == (1 - 4) * (2 - 5) * (3 - 6));
+ return;
+ }
+
+ void partial_sum_test()
+ {
+ using boost::phoenix::partial_sum;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int output[3];
+ BOOST_TEST(partial_sum(arg1, arg2)(array, output) == output + 3);
+ int expected_result[] = {1, 3, 6};
+ BOOST_TEST(std::equal(output, output + 3, expected_result));
+
+ BOOST_TEST(boost::phoenix::partial_sum(arg1, arg2, std::multiplies<int>())
+ (array, output) == output + 3);
+ int expected_result2[] = {1, 2, 6};
+ BOOST_TEST(std::equal(output, output + 3, expected_result2));
+ return;
+ }
+
+ void adjacent_difference_test()
+ {
+ using boost::phoenix::adjacent_difference;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int array[] = {1,2,3};
+ int output[3];
+ BOOST_TEST(adjacent_difference(arg1, arg2)(array, output) == output + 3);
+ int expected_result[] = {1, 1, 1};
+ BOOST_TEST(std::equal(output, output + 3, expected_result));
+ BOOST_TEST(boost::phoenix::adjacent_difference(arg1, arg2, std::plus<int>())
+ (array, output) == output + 3);
+ int expected_result2[] = {1, 3, 5};
+ BOOST_TEST(std::equal(output, output + 3, expected_result2));
+ return;
+ }
+
+}
+
+int main()
+{
+ heap_test();
+ next_permutation_test();
+ prev_permutation_test();
+ inner_product_test();
+ partial_sum_test();
+ adjacent_difference_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bind/bind_function_object_tests.cpp b/src/boost/libs/phoenix/test/bind/bind_function_object_tests.cpp
new file mode 100644
index 000000000..7e2ee94a9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bind/bind_function_object_tests.cpp
@@ -0,0 +1,137 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/bind.hpp>
+
+namespace phoenix = boost::phoenix;
+using std::cout;
+using std::pow;
+
+ struct test
+ {
+ typedef void result_type;
+
+ void
+ operator()() const
+ {
+ cout << "Test lazy functions...\n";
+ }
+ };
+
+ struct sqr
+ {
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Arg>
+ struct result<This(Arg&)>
+ {
+ typedef Arg type;
+ };
+
+ template <typename Arg>
+ Arg
+ operator()(Arg n) const
+ {
+ return n * n;
+ }
+ };
+
+ struct fact
+ {
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Arg>
+ struct result<This(Arg&)>
+ {
+ typedef Arg type;
+ };
+
+ template <typename Arg>
+ Arg
+ operator()(Arg n) const
+ {
+ return (n <= 0) ? 1 : n * (*this)(n-1);
+ }
+ };
+
+ struct power
+ {
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename Arg1, typename Arg2>
+ struct result<This(Arg1&, Arg2&)>
+ {
+ typedef Arg1 type;
+ };
+
+ template <typename Arg1, typename Arg2>
+ Arg1
+ operator()(Arg1 a, Arg2 b) const
+ {
+ return pow(a, b);
+ }
+ };
+
+ struct add
+ {
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ struct result<This(Arg1&, Arg2&, Arg3&, Arg4&)>
+ {
+ typedef Arg1 type;
+ };
+
+ template <typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ Arg1
+ operator()(Arg1 a, Arg2 b, Arg3 c, Arg4 d) const
+ {
+ return a + b + c + d;
+ }
+ };
+
+int
+main()
+{
+ using phoenix::bind;
+ using phoenix::ref;
+ using phoenix::arg_names::_1;
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+
+ int i5 = 5;
+ double d5 = 5, d3 = 3;
+
+ test()();
+ BOOST_TEST(bind(sqr(), arg1)(i5) == (i5*i5));
+ BOOST_TEST(bind(fact(), 4)() == 24);
+ BOOST_TEST(bind(fact(), arg1)(i5) == 120);
+ BOOST_TEST((int)bind(power(), arg1, arg2)(d5, d3) == (int)std::pow(d5, d3));
+ BOOST_TEST((bind(sqr(), arg1) + 5)(i5) == ((i5*i5)+5));
+ BOOST_TEST(bind(add(), arg1, arg1, arg1, arg1)(i5) == (5+5+5+5));
+
+ int const ic5 = 5;
+ // testing consts
+ BOOST_TEST(bind(sqr(), arg1)(ic5) == (ic5*ic5));
+
+ // From Steven Watanabe
+ sqr s;
+ int x = 2;
+ int result = bind(ref(s), _1)(x);
+ BOOST_TEST(result == 4);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bind/bind_function_tests.cpp b/src/boost/libs/phoenix/test/bind/bind_function_tests.cpp
new file mode 100644
index 000000000..04328b60a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bind/bind_function_tests.cpp
@@ -0,0 +1,56 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ ==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+namespace test
+{
+ void
+ test()
+ {
+ std::cout << "Test binding functions...\n";
+ }
+
+ int
+ negate(int n)
+ {
+ return -n;
+ }
+
+ int
+ plus(int a, int b)
+ {
+ return a + b;
+ }
+
+ int
+ plus4(int a, int b, int c, int d)
+ {
+ return a + b + c + d;
+ }
+}
+
+int
+main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+
+ int a = 123;
+ int b = 256;
+
+ bind(test::test)();
+ BOOST_TEST(bind(test::negate, arg1)(a) == -a);
+ BOOST_TEST(bind(test::plus, arg1, arg2)(a, b) == a+b);
+ BOOST_TEST(bind(test::plus4, arg1, arg2, 3, 4)(a, b) == a+b+3+4);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bind/bind_member_function_tests.cpp b/src/boost/libs/phoenix/test/bind/bind_member_function_tests.cpp
new file mode 100644
index 000000000..ee26f00f5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bind/bind_member_function_tests.cpp
@@ -0,0 +1,77 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/bind.hpp>
+
+namespace test
+{
+ struct x //: boost::noncopyable // test non-copyable (hold this by reference)
+ {
+ void
+ test() const
+ {
+ std::cout << "Test binding member functions...\n";
+ }
+ };
+
+ struct y //: boost::noncopyable // test non-copyable (hold this by reference)
+ {
+ int
+ negate(int n) const
+ {
+ return -n;
+ }
+ };
+
+ struct z //: boost::noncopyable // test non-copyable (hold this by reference)
+ {
+ int
+ plus(int a, int b) const
+ {
+ return a + b;
+ }
+ };
+
+ struct zz //: boost::noncopyable // test non-copyable (hold this by reference)
+ {
+ int
+ plus3(int a, int b, int c) const
+ {
+ return a + b + c;
+ }
+ };
+}
+
+int
+main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+
+ int a = 123;
+ int b = 256;
+ test::x x_;
+ test::y y_;
+ test::z z_;
+ test::zz zz_;
+
+ bind(&test::x::test, x_)();
+ BOOST_TEST(bind(&test::y::negate, y_, arg1)(a) == -a);
+ BOOST_TEST(bind(&test::z::plus, arg1, arg2, arg3)(z_, a, b) == a+b);
+ BOOST_TEST(bind(&test::zz::plus3, zz_, arg1, arg2, arg3)(a, b, a) == a+b+a);
+ BOOST_TEST(bind(&test::y::negate, &y_, 777)(a) == -777);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bind/bind_member_variable_tests.cpp b/src/boost/libs/phoenix/test/bind/bind_member_variable_tests.cpp
new file mode 100644
index 000000000..9c5255440
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bind/bind_member_variable_tests.cpp
@@ -0,0 +1,111 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <boost/noncopyable.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+
+namespace test
+{
+ struct x //: boost::noncopyable // test non-copyable (hold this by reference)
+ {
+ int m;
+ };
+
+ struct xx {
+ int m;
+ };
+}
+
+template <typename T, typename F>
+void
+write_test(F f)
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::bind;
+
+ T x_;
+
+ bind(&T::m, f(x_))() = 122;
+ BOOST_TEST(x_.m == 122);
+ bind(&T::m, arg1)(f(x_)) = 123;
+ BOOST_TEST(x_.m == 123);
+}
+
+template <typename T, typename F>
+void
+read_test(F f)
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::bind;
+
+ T x_;
+ x_.m = 123;
+
+ BOOST_TEST(bind(&T::m, f(x_))() == 123);
+ BOOST_TEST(bind(&T::m, arg1)(f(x_)) == 123);
+}
+
+struct identity
+{
+ template <typename T>
+ T&
+ operator()(T& t) const
+ {
+ return t;
+ }
+};
+
+struct constify
+{
+ template <typename T>
+ T const&
+ operator()(T const& t) const
+ {
+ return t;
+ }
+};
+
+struct add_pointer
+{
+ template <typename T>
+ T* /*const*/
+ operator()(T& t) const
+ {
+ return &t;
+ }
+};
+
+struct add_const_pointer
+{
+ template <typename T>
+ const T* /*const*/
+ operator()(T const& t) const
+ {
+ return &t;
+ }
+};
+
+int
+main()
+{
+ write_test<test::x>(add_pointer());
+ write_test<test::xx>(add_pointer());
+
+ read_test<test::x>(identity());
+ read_test<test::x>(constify());
+ read_test<test::x>(add_pointer());
+ read_test<test::x>(add_const_pointer());
+ read_test<test::xx>(identity());
+ read_test<test::xx>(constify());
+ read_test<test::xx>(add_pointer());
+ read_test<test::xx>(add_const_pointer());
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bind/bug5782.cpp b/src/boost/libs/phoenix/test/bind/bug5782.cpp
new file mode 100644
index 000000000..37b38c973
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bind/bug5782.cpp
@@ -0,0 +1,23 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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/bind/bind_function.hpp>
+#include <boost/phoenix/core/argument.hpp>
+
+#include <iostream>
+
+using namespace boost::phoenix;
+using namespace boost::phoenix::placeholders;
+
+void foo(int n)
+{
+ std::cout << n << std::endl;
+}
+
+int main()
+{
+ bind(&foo, arg1)(4);
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/algorithm_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/algorithm_test.cpp
new file mode 100644
index 000000000..ef0fff11c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/algorithm_test.cpp
@@ -0,0 +1,78 @@
+// bll_and_function.cpp - The Boost Lambda Library -----------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// test using BLL and boost::function
+
+#include <boost/core/lightweight_test.hpp>
+
+/*
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/bind.hpp"
+#include "boost/lambda/algorithm.hpp"
+*/
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/scope.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+
+#include <vector>
+#include <map>
+#include <set>
+#include <string>
+
+#include <iostream>
+
+namespace phoenix = boost::phoenix;
+
+void test_foreach() {
+
+ using phoenix::placeholders::_1;
+ using phoenix::ref;
+ using phoenix::lambda;
+
+ int a[10][20];
+ int sum = 0;
+
+ //for_each(arg1, for_each_tester())(array).value_;
+
+ // Was:
+ // std::for_each(a, a + 10,
+ // bind(ll::for_each(), _1, _1 + 20,
+ // protect((_1 = var(sum), ++var(sum)))));
+ // var replaced with ref, protect(..) replaced with lambda[..], no need for bind
+ // phoenix algorithms are range based
+ std::for_each(a, a + 10,
+ phoenix::for_each(_1, lambda[_1 = ref(sum), ++ref(sum)]));
+ /*phoenix::bind(phoenix::for_each, _1,
+ lambda[_1 = ref(sum), ++ref(sum)]));*/
+
+ sum = 0;
+ // Was:
+ // std::for_each(a, a + 10,
+ // bind(ll::for_each(), _1, _1 + 20,
+ // protect((sum += _1))));
+ //
+ std::for_each(a, a + 10,
+ phoenix::for_each( _1,
+ lambda[(ref(sum) += _1)]));
+
+ BOOST_TEST_EQ(sum, (199 + 1)/ 2 * 199);
+}
+
+// More tests needed (for all algorithms)
+
+int main()
+{
+ test_foreach();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_advanced.cpp b/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_advanced.cpp
new file mode 100644
index 000000000..5dac0d681
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_advanced.cpp
@@ -0,0 +1,433 @@
+// bind_tests_advanced.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+// Copyright (C) 2010 Steven Watanabe
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+/*
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/bind.hpp"
+*/
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include "boost/any.hpp"
+#include "boost/type_traits/is_reference.hpp"
+#include "boost/mpl/assert.hpp"
+#include "boost/mpl/if.hpp"
+
+#include <iostream>
+
+#include <functional>
+
+#include <algorithm>
+
+namespace phoenix = boost::phoenix;
+
+int sum_0() { return 0; }
+int sum_1(int a) { return a; }
+int sum_2(int a, int b) { return a+b; }
+
+int product_2(int a, int b) { return a*b; }
+
+// unary function that returns a pointer to a binary function
+typedef int (*fptr_type)(int, int);
+fptr_type sum_or_product(bool x) {
+ return x ? sum_2 : product_2;
+}
+
+// a nullary functor that returns a pointer to a unary function that
+// returns a pointer to a binary function.
+struct which_one {
+ typedef fptr_type (*result_type)(bool x);
+
+ // Was:
+ // template <class T> struct sig { typedef result_type type; };
+ // phoenix follows the standard result_of protocol
+
+ result_type operator()() const { return sum_or_product; }
+};
+
+void test_nested_binds()
+{
+ using phoenix::bind;
+ using phoenix::placeholders::_1;
+ using phoenix::placeholders::_2;
+ using phoenix::placeholders::_3;
+ int j = 2; int k = 3;
+
+// bind calls can be nested (the target function can be a lambda functor)
+// The interpretation is, that the innermost lambda functor returns something
+// that is bindable (another lambda functor, function pointer ...)
+ bool condition;
+
+ condition = true;
+ BOOST_TEST_EQ(bind(bind(&sum_or_product, _1), 1, 2)(condition), 3);
+ BOOST_TEST_EQ(bind(bind(&sum_or_product, _1), _2, _3)(condition, j, k), 5);
+
+ condition = false;
+ BOOST_TEST_EQ(bind(bind(&sum_or_product, _1), 1, 2)(condition), 2);
+ BOOST_TEST_EQ(bind(bind(&sum_or_product, _1), _2, _3)(condition, j, k), 6);
+
+
+ which_one wo;
+ BOOST_TEST_EQ(bind(bind(bind(wo), _1), _2, _3)(condition, j, k), 6);
+
+
+ return;
+}
+
+
+// unlambda -------------------------------------------------
+
+ // Sometimes it may be necessary to prevent the argument substitution of
+ // taking place. For example, we may end up with a nested bind expression
+ // inadvertently when using the target function is received as a parameter
+
+template<class F>
+int call_with_100(const F& f) {
+
+
+
+ // bind(f, _1)(make_const(100));
+ // This would result in;
+ // bind(_1 + 1, _1)(make_const(100)) , which would be a compile time error
+
+ //return bl::bind(unlambda(f), _1)(make_const(100));
+ return 5;
+
+ // for other functors than lambda functors, unlambda has no effect
+ // (except for making them const)
+}
+
+template<class F>
+int call_with_101(const F& f) {
+
+ //return bind(unlambda(f), _1)(make_const(101));
+ return 5;
+
+}
+
+
+void test_unlambda() {
+
+ using phoenix::placeholders::_1;
+ using phoenix::placeholders::_2;
+
+ int i = 1;
+
+ //BOOST_TEST_EQ(unlambda(_1 + _2)(i, i), 2);
+ //BOOST_TEST_EQ(unlambda(++var(i))(), 2);
+ //BOOST_TEST_EQ(call_with_100(_1 + 1), 101);
+
+
+ //BOOST_TEST_EQ(call_with_101(_1 + 1), 102);
+
+ //BOOST_TEST_EQ(call_with_100(bl::bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)), 101);
+
+ // Was:
+ // std_functor insturcts LL that the functor defines a result_type typedef
+ // rather than a sig template.
+ //bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
+ // Standard functors can be used without any further action needed.
+ phoenix::bind(std::plus<int>(), _1, _2)(i, i);
+}
+
+
+
+
+// protect ------------------------------------------------------------
+
+// protect protects a lambda functor from argument substitution.
+// protect is useful e.g. with nested stl algorithm calls.
+
+#if 0
+namespace ll {
+
+struct for_each {
+
+ // Was:
+ // note, std::for_each returns it's last argument
+ // We want the same behaviour from our ll::for_each.
+ // However, the functor can be called with any arguments, and
+ // the return type thus depends on the argument types.
+
+ // 1. Provide a sig class member template:
+
+ // The return type deduction system instantiate this class as:
+ // sig<Args>::type, where Args is a boost::tuples::cons-list
+ // The head type is the function object type itself
+ // cv-qualified (so it is possilbe to provide different return types
+ // for differently cv-qualified operator()'s.
+
+ // The tail type is the list of the types of the actual arguments the
+ // function was called with.
+ // So sig should contain a typedef type, which defines a mapping from
+ // the operator() arguments to its return type.
+ // Note, that it is possible to provide different sigs for the same functor
+ // if the functor has several operator()'s, even if they have different
+ // number of arguments.
+
+ // Note, that the argument types in Args are guaranteed to be non-reference
+ // types, but they can have cv-qualifiers.
+
+ // template <class Args>
+ //struct sig {
+ // typedef typename boost::remove_const<
+ // typename boost::tuples::element<3, Args>::type
+ // >::type type;
+ //};
+
+ // We follow the result_of protocol ...
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename A, typename B, typename C>
+ struct result<This(A&,B&,C&)>
+ {typedef C type;};
+
+ template <class A, class B, class C>
+ C
+ operator()(const A& a, const B& b, const C& c) const
+ { return std::for_each(a, b, c);}
+};
+
+} // end of ll namespace
+#endif
+
+void test_protect()
+{
+ using phoenix::placeholders::_1;
+ int i = 0;
+ int b[3][5];
+ int* a[3];
+
+ for(int j=0; j<3; ++j) a[j] = b[j];
+
+ // Was:
+ //std::for_each(a, a+3,
+ // bind(ll::for_each(), _1, _1 + 5, protect(_1 = ++var(i))));
+#if 0
+ std::for_each(a, a+3,
+ phoenix::bind(ll::for_each(), _1, _1 + 5, phoenix::lambda[_1 = ++phoenix::ref(i)]));
+#endif
+
+
+ // This is how you could output the values (it is uncommented, no output
+ // from a regression test file):
+ // std::for_each(a, a+3,
+ // bind(ll::for_each(), _1, _1 + 5,
+ // std::cout << constant("\nLine ") << (&_1 - a) << " : "
+ // << protect(_1)
+ // )
+ // );
+
+ int sum = 0;
+
+ // Was:
+ //std::for_each(a, a+3,
+ // bind(ll::for_each(), _1, _1 + 5,
+ // protect(sum += _1))
+ // );
+#if 0
+ std::for_each(a, a+3,
+ phoenix::bind(ll::for_each(), _1, _1 + 5,
+ phoenix::lambda[phoenix::ref(sum) += _1])
+ );
+ BOOST_TEST_EQ(sum, (1+15)*15/2);
+#endif
+
+ sum = 0;
+
+ // Was:
+ //std::for_each(a, a+3,
+ // bind(ll::for_each(), _1, _1 + 5,
+ // sum += 1 + protect(_1)) // add element count
+ // );
+#if 0
+ std::for_each(a, a+3,
+ phoenix::bind(ll::for_each(), _1, _1 + 5,
+ phoenix::ref(sum) += 1 + phoenix::lambda[_1]) // add element count
+ );
+ BOOST_TEST_EQ(sum, (1+15)*15/2 + 15);
+#endif
+
+ // Was:
+ //(1 + protect(_1))(sum);
+ (1 + phoenix::lambda[_1])(sum);
+
+ int k = 0;
+ // Was:
+ //((k += constant(1)) += protect(constant(2)))();
+ ((phoenix::ref(k) += 1) += phoenix::lambda[phoenix::cref(2)])();
+ BOOST_TEST_EQ(k, 1);
+
+ k = 0;
+ // Was:
+ //((k += constant(1)) += protect(constant(2)))()();
+ //((phoenix::ref(k) += 1) += phoenix::lambda[std::cout << phoenix::cref("ok ...\n"), phoenix::cref(2)])()();
+ //std::cout << ((phoenix::ref(k) += 1) + phoenix::lambda[phoenix::cref(2)])()() << "\n";
+ ((phoenix::ref(k) += 1) += 2)();
+ std::cout << k << "\n";
+ BOOST_TEST_EQ(k, 3);
+
+ // note, the following doesn't work:
+
+ // ((var(k) = constant(1)) = protect(constant(2)))();
+
+ // (var(k) = constant(1))() returns int& and thus the
+ // second assignment fails.
+
+ // We should have something like:
+ // bind(var, var(k) = constant(1)) = protect(constant(2)))();
+ // But currently var is not bindable.
+
+ // The same goes with ret. A bindable ret could be handy sometimes as well
+ // (protect(std::cout << _1), std::cout << _1)(i)(j); does not work
+ // because the comma operator tries to store the result of the evaluation
+ // of std::cout << _1 as a copy (and you can't copy std::ostream).
+ // something like this:
+ // (protect(std::cout << _1), bind(ref, std::cout << _1))(i)(j);
+
+
+ // the stuff below works, but we do not want extra output to
+ // cout, must be changed to stringstreams but stringstreams do not
+ // work due to a bug in the type deduction. Will be fixed...
+#if 0
+ // But for now, ref is not bindable. There are other ways around this:
+
+ int x = 1, y = 2;
+ (protect(std::cout << _1), (std::cout << _1, 0))(x)(y);
+
+ // added one dummy value to make the argument to comma an int
+ // instead of ostream&
+
+ // Note, the same problem is more apparent without protect
+ // (std::cout << 1, std::cout << constant(2))(); // does not work
+
+ (boost::ref(std::cout << 1), std::cout << constant(2))(); // this does
+
+#endif
+
+}
+
+
+void test_lambda_functors_as_arguments_to_lambda_functors() {
+ using phoenix::bind;
+ using phoenix::cref;
+ using phoenix::placeholders::_1;
+ using phoenix::placeholders::_2;
+ using phoenix::placeholders::_3;
+
+// lambda functor is a function object, and can therefore be used
+// as an argument to another lambda functors function call object.
+
+ // Note however, that the argument/type substitution is not entered again.
+ // This means, that something like this will not work:
+
+ (_1 + _2)(_1, cref(7));
+ (_1 + _2)(bind(&sum_0), cref(7));
+
+ // or it does work, but the effect is not to call
+ // sum_0() + 7, but rather
+ // bind(sum_0) + 7, which results in another lambda functor
+ // (lambda functor + int) and can be called again
+ BOOST_TEST_EQ((_1 + _2)(bind(&sum_0), cref(7))(), 7);
+
+ int i = 3, j = 12;
+ BOOST_TEST_EQ((_1 - _2)(_2, _1)(i, j), j - i);
+
+ // also, note that lambda functor are no special case for bind if received
+ // as a parameter. In oder to be bindable, the functor must
+ // defint the sig template, or then
+ // the return type must be defined within the bind call. Lambda functors
+ // do define the sig template, so if the return type deduction system
+ // covers the case, there is no need to specify the return type
+ // explicitly.
+
+ int a = 5, b = 6;
+
+ // Let type deduction find out the return type
+ //BOOST_TEST_EQ(bind(_1, _2, _3)(unlambda(_1 + _2), a, b), 11);
+
+ //specify it yourself:
+ BOOST_TEST_EQ(bind(_1, _2, _3)(_1 + _2, a, b), 11);
+
+ bind(_1,1.0)(_1+_1);
+ return;
+
+}
+/*
+template<class T>
+struct func {
+ template<class Args>
+ struct sig {
+ typedef typename boost::tuples::element<1, Args>::type arg1;
+ // If the argument type is not the same as the expected type,
+ // return void, which will cause an error. Note that we
+ // can't just assert that the types are the same, because
+ // both const and non-const versions can be instantiated
+ // even though only one is ultimately used.
+ typedef typename boost::mpl::if_<boost::is_same<arg1, T>,
+ typename boost::remove_const<arg1>::type,
+ void
+ >::type type;
+ };
+ template<class U>
+ U operator()(const U& arg) const {
+ return arg;
+ }
+};
+
+void test_sig()
+{
+ int i = 1;
+ BOOST_TEST_EQ(bind(func<int>(), 1)(), 1);
+ BOOST_TEST_EQ(bind(func<const int>(), _1)(static_cast<const int&>(i)), 1);
+ BOOST_TEST_EQ(bind(func<int>(), _1)(i), 1);
+}
+
+class base {
+public:
+ virtual int foo() = 0;
+};
+
+class derived : public base {
+public:
+ virtual int foo() {
+ return 1;
+ }
+};
+
+void test_abstract()
+{
+ derived d;
+ base& b = d;
+ BOOST_TEST_EQ(bind(&base::foo, var(b))(), 1);
+ BOOST_TEST_EQ(bind(&base::foo, *_1)(&b), 1);
+}
+*/
+
+int main()
+{
+ test_nested_binds();
+ test_unlambda();
+ test_protect();
+ test_lambda_functors_as_arguments_to_lambda_functors();
+ //test_sig();
+ //test_abstract();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple.cpp b/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple.cpp
new file mode 100644
index 000000000..ddd25e454
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple.cpp
@@ -0,0 +1,170 @@
+// bind_tests_simple.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/bind.hpp"
+
+#include <iostream>
+
+using namespace boost::lambda;
+
+
+int sum_of_args_0() { return 0; }
+int sum_of_args_1(int a) { return a; }
+int sum_of_args_2(int a, int b) { return a+b; }
+int sum_of_args_3(int a, int b, int c) { return a+b+c; }
+int sum_of_args_4(int a, int b, int c, int d) { return a+b+c+d; }
+int sum_of_args_5(int a, int b, int c, int d, int e) { return a+b+c+d+e; }
+int sum_of_args_6(int a, int b, int c, int d, int e, int f) { return a+b+c+d+e+f; }
+int sum_of_args_7(int a, int b, int c, int d, int e, int f, int g) { return a+b+c+d+e+f+g; }
+int sum_of_args_8(int a, int b, int c, int d, int e, int f, int g, int h) { return a+b+c+d+e+f+g+h; }
+int sum_of_args_9(int a, int b, int c, int d, int e, int f, int g, int h, int i) { return a+b+c+d+e+f+g+h+i; }
+
+
+// ----------------------------
+
+class A {
+ int i;
+public:
+ A(int n) : i(n) {};
+ int add(const int& j) { return i + j; }
+ int add2(int a1, int a2) { return i + a1 + a2; }
+ int add3(int a1, int a2, int a3) { return i + a1 + a2 + a3; }
+ int add4(int a1, int a2, int a3, int a4) { return i + a1 + a2 + a3 + a4; }
+ int add5(int a1, int a2, int a3, int a4, int a5)
+ { return i + a1 + a2 + a3 + a4 + a5; }
+ int add6(int a1, int a2, int a3, int a4, int a5, int a6)
+ { return i + a1 + a2 + a3 + a4 + a5 + a6; }
+ int add7(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+ { return i + a1 + a2 + a3 + a4 + a5 + a6 + a7; }
+ int add8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+ { return i + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8; }
+
+};
+
+void test_member_functions()
+{
+ using boost::ref;
+ A a(10);
+ int i = 1;
+
+
+
+
+ BOOST_TEST_EQ(bind(&A::add, ref(a), _1)(i), 11);
+ BOOST_TEST_EQ(bind(&A::add, &a, _1)(i), 11);
+ BOOST_TEST_EQ(bind(&A::add, _1, 1)(a), 11);
+ BOOST_TEST_EQ(bind(&A::add, _1, 1)(make_const(&a)), 11);
+
+ BOOST_TEST_EQ(bind(&A::add2, _1, 1, 1)(a), 12);
+ BOOST_TEST_EQ(bind(&A::add3, _1, 1, 1, 1)(a), 13);
+ BOOST_TEST_EQ(bind(&A::add4, _1, 1, 1, 1, 1)(a), 14);
+ BOOST_TEST_EQ(bind(&A::add5, _1, 1, 1, 1, 1, 1)(a), 15);
+ BOOST_TEST_EQ(bind(&A::add6, _1, 1, 1, 1, 1, 1, 1)(a), 16);
+ BOOST_TEST_EQ(bind(&A::add7, _1, 1, 1, 1, 1, 1, 1, 1)(a), 17);
+ BOOST_TEST_EQ(bind(&A::add8, _1, 1, 1, 1, 1, 1, 1, 1, 1)(a), 18);
+
+ // This should fail, as lambda functors store arguments as const
+ // bind(&A::add, a, _1);
+}
+
+int main()
+{
+
+ int i = 1; int j = 2; int k = 3;
+ int result;
+
+ // bind all parameters
+ BOOST_TEST_EQ(bind(&sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(&sum_of_args_1, 1)(), 1);
+ BOOST_TEST_EQ(bind(&sum_of_args_2, 1, 2)(), 3);
+ BOOST_TEST_EQ(bind(&sum_of_args_3, 1, 2, 3)(), 6);
+ BOOST_TEST_EQ(bind(&sum_of_args_4, 1, 2, 3, 4)(), 10);
+ BOOST_TEST_EQ(bind(&sum_of_args_5, 1, 2, 3, 4, 5)(), 15);
+ BOOST_TEST_EQ(bind(&sum_of_args_6, 1, 2, 3, 4, 5, 6)(), 21);
+ BOOST_TEST_EQ(bind(&sum_of_args_7, 1, 2, 3, 4, 5, 6, 7)(), 28);
+ BOOST_TEST_EQ(bind(&sum_of_args_8, 1, 2, 3, 4, 5, 6, 7, 8)(), 36);
+ BOOST_TEST_EQ(bind(&sum_of_args_9, 1, 2, 3, 4, 5, 6, 7, 8, 9)(), 45);
+
+ // first parameter open
+ BOOST_TEST_EQ(bind(&sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(&sum_of_args_1, _1)(i), 1);
+ BOOST_TEST_EQ(bind(&sum_of_args_2, _1, 2)(i), 3);
+ BOOST_TEST_EQ(bind(&sum_of_args_3, _1, 2, 3)(i), 6);
+ BOOST_TEST_EQ(bind(&sum_of_args_4, _1, 2, 3, 4)(i), 10);
+ BOOST_TEST_EQ(bind(&sum_of_args_5, _1, 2, 3, 4, 5)(i), 15);
+ BOOST_TEST_EQ(bind(&sum_of_args_6, _1, 2, 3, 4, 5, 6)(i), 21);
+ BOOST_TEST_EQ(bind(&sum_of_args_7, _1, 2, 3, 4, 5, 6, 7)(i), 28);
+ BOOST_TEST_EQ(bind(&sum_of_args_8, _1, 2, 3, 4, 5, 6, 7, 8)(i), 36);
+ BOOST_TEST_EQ(bind(&sum_of_args_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i), 45);
+
+ // two open arguments
+ BOOST_TEST_EQ(bind(&sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(&sum_of_args_1, _1)(i), 1);
+ BOOST_TEST_EQ(bind(&sum_of_args_2, _1, _2)(i, j), 3);
+ BOOST_TEST_EQ(bind(&sum_of_args_3, _1, _2, 3)(i, j), 6);
+ BOOST_TEST_EQ(bind(&sum_of_args_4, _1, _2, 3, 4)(i, j), 10);
+ BOOST_TEST_EQ(bind(&sum_of_args_5, _1, _2, 3, 4, 5)(i, j), 15);
+ BOOST_TEST_EQ(bind(&sum_of_args_6, _1, _2, 3, 4, 5, 6)(i, j), 21);
+ BOOST_TEST_EQ(bind(&sum_of_args_7, _1, _2, 3, 4, 5, 6, 7)(i, j), 28);
+ BOOST_TEST_EQ(bind(&sum_of_args_8, _1, _2, 3, 4, 5, 6, 7, 8)(i, j), 36);
+ BOOST_TEST_EQ(bind(&sum_of_args_9, _1, _2, 3, 4, 5, 6, 7, 8, 9)(i, j), 45);
+
+ // three open arguments
+ BOOST_TEST_EQ(bind(&sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(&sum_of_args_1, _1)(i), 1);
+ BOOST_TEST_EQ(bind(&sum_of_args_2, _1, _2)(i, j), 3);
+ BOOST_TEST_EQ(bind(&sum_of_args_3, _1, _2, _3)(i, j, k), 6);
+ BOOST_TEST_EQ(bind(&sum_of_args_4, _1, _2, _3, 4)(i, j, k), 10);
+ BOOST_TEST_EQ(bind(&sum_of_args_5, _1, _2, _3, 4, 5)(i, j, k), 15);
+ BOOST_TEST_EQ(bind(&sum_of_args_6, _1, _2, _3, 4, 5, 6)(i, j, k), 21);
+ BOOST_TEST_EQ(bind(&sum_of_args_7, _1, _2, _3, 4, 5, 6, 7)(i, j, k), 28);
+ BOOST_TEST_EQ(bind(&sum_of_args_8, _1, _2, _3, 4, 5, 6, 7, 8)(i, j, k), 36);
+ BOOST_TEST_EQ(bind(&sum_of_args_9, _1, _2, _3, 4, 5, 6, 7, 8, 9)(i, j, k), 45);
+
+ // function compositions with bind
+ BOOST_TEST_EQ(bind(&sum_of_args_3, bind(&sum_of_args_2, _1, 2), 2, 3)(i), 8);
+ BOOST_TEST_EQ(
+ bind(&sum_of_args_9,
+ bind(&sum_of_args_0), // 0
+ bind(&sum_of_args_1, _1), // 1
+ bind(&sum_of_args_2, _1, _2), // 3
+ bind(&sum_of_args_3, _1, _2, _3), // 6
+ bind(&sum_of_args_4, _1, _2, _3, 4), // 10
+ bind(&sum_of_args_5, _1, _2, _3, 4, 5), // 15
+ bind(&sum_of_args_6, _1, _2, _3, 4, 5, 6), // 21
+ bind(&sum_of_args_7, _1, _2, _3, 4, 5, 6, 7), // 28
+ bind(&sum_of_args_8, _1, _2, _3, 4, 5, 6, 7, 8) // 36
+ )(i, j, k), 120);
+
+ // deeper nesting
+ result =
+ bind(&sum_of_args_1, // 12
+ bind(&sum_of_args_4, // 12
+ bind(&sum_of_args_2, // 3
+ bind(&sum_of_args_1, // 1
+ bind(&sum_of_args_1, _1) // 1
+ ),
+ _2),
+ _2,
+ _3,
+ 4)
+ )(i, j, k);
+ BOOST_TEST_EQ(result, 12);
+
+ test_member_functions();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple_f_refs.cpp b/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple_f_refs.cpp
new file mode 100644
index 000000000..5403a01cd
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/bind_tests_simple_f_refs.cpp
@@ -0,0 +1,147 @@
+// bind_tests_simple.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/bind.hpp"
+
+#include <iostream>
+
+using namespace boost::lambda;
+
+
+int sum_of_args_0() { return 0; }
+int sum_of_args_1(int a) { return a; }
+int sum_of_args_2(int a, int b) { return a+b; }
+int sum_of_args_3(int a, int b, int c) { return a+b+c; }
+int sum_of_args_4(int a, int b, int c, int d) { return a+b+c+d; }
+int sum_of_args_5(int a, int b, int c, int d, int e) { return a+b+c+d+e; }
+int sum_of_args_6(int a, int b, int c, int d, int e, int f) { return a+b+c+d+e+f; }
+int sum_of_args_7(int a, int b, int c, int d, int e, int f, int g) { return a+b+c+d+e+f+g; }
+int sum_of_args_8(int a, int b, int c, int d, int e, int f, int g, int h) { return a+b+c+d+e+f+g+h; }
+int sum_of_args_9(int a, int b, int c, int d, int e, int f, int g, int h, int i) { return a+b+c+d+e+f+g+h+i; }
+
+
+// ----------------------------
+
+class A {
+ int i;
+public:
+ A(int n) : i(n) {};
+ int add(const int& j) { return i + j; }
+};
+
+void test_member_functions()
+{
+ using boost::ref;
+ A a(10);
+ int i = 1;
+
+ BOOST_TEST_EQ(bind(&A::add, ref(a), _1)(i), 11);
+ BOOST_TEST_EQ(bind(&A::add, &a, _1)(i), 11);
+ BOOST_TEST_EQ(bind(&A::add, _1, 1)(a), 11);
+ BOOST_TEST_EQ(bind(&A::add, _1, 1)(make_const(&a)), 11);
+
+ // This should fail, as lambda functors store arguments as const
+ // bind(&A::add, a, _1);
+}
+
+int main()
+{
+ int i = 1; int j = 2; int k = 3;
+ int result;
+
+
+ // bind all parameters
+ BOOST_TEST_EQ(bind(sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(sum_of_args_1, 1)(), 1);
+ BOOST_TEST_EQ(bind(sum_of_args_2, 1, 2)(), 3);
+ BOOST_TEST_EQ(bind(sum_of_args_3, 1, 2, 3)(), 6);
+ BOOST_TEST_EQ(bind(sum_of_args_4, 1, 2, 3, 4)(), 10);
+ BOOST_TEST_EQ(bind(sum_of_args_5, 1, 2, 3, 4, 5)(), 15);
+ BOOST_TEST_EQ(bind(sum_of_args_6, 1, 2, 3, 4, 5, 6)(), 21);
+ BOOST_TEST_EQ(bind(sum_of_args_7, 1, 2, 3, 4, 5, 6, 7)(), 28);
+ BOOST_TEST_EQ(bind(sum_of_args_8, 1, 2, 3, 4, 5, 6, 7, 8)(), 36);
+ BOOST_TEST_EQ(bind(sum_of_args_9, 1, 2, 3, 4, 5, 6, 7, 8, 9)(), 45);
+
+ // first parameter open
+ BOOST_TEST_EQ(bind(sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(sum_of_args_1, _1)(i), 1);
+ BOOST_TEST_EQ(bind(sum_of_args_2, _1, 2)(i), 3);
+ BOOST_TEST_EQ(bind(sum_of_args_3, _1, 2, 3)(i), 6);
+ BOOST_TEST_EQ(bind(sum_of_args_4, _1, 2, 3, 4)(i), 10);
+ BOOST_TEST_EQ(bind(sum_of_args_5, _1, 2, 3, 4, 5)(i), 15);
+ BOOST_TEST_EQ(bind(sum_of_args_6, _1, 2, 3, 4, 5, 6)(i), 21);
+ BOOST_TEST_EQ(bind(sum_of_args_7, _1, 2, 3, 4, 5, 6, 7)(i), 28);
+ BOOST_TEST_EQ(bind(sum_of_args_8, _1, 2, 3, 4, 5, 6, 7, 8)(i), 36);
+ BOOST_TEST_EQ(bind(sum_of_args_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i), 45);
+
+ // two open arguments
+ BOOST_TEST_EQ(bind(sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(sum_of_args_1, _1)(i), 1);
+ BOOST_TEST_EQ(bind(sum_of_args_2, _1, _2)(i, j), 3);
+ BOOST_TEST_EQ(bind(sum_of_args_3, _1, _2, 3)(i, j), 6);
+ BOOST_TEST_EQ(bind(sum_of_args_4, _1, _2, 3, 4)(i, j), 10);
+ BOOST_TEST_EQ(bind(sum_of_args_5, _1, _2, 3, 4, 5)(i, j), 15);
+ BOOST_TEST_EQ(bind(sum_of_args_6, _1, _2, 3, 4, 5, 6)(i, j), 21);
+ BOOST_TEST_EQ(bind(sum_of_args_7, _1, _2, 3, 4, 5, 6, 7)(i, j), 28);
+ BOOST_TEST_EQ(bind(sum_of_args_8, _1, _2, 3, 4, 5, 6, 7, 8)(i, j), 36);
+ BOOST_TEST_EQ(bind(sum_of_args_9, _1, _2, 3, 4, 5, 6, 7, 8, 9)(i, j), 45);
+
+ // three open arguments
+ BOOST_TEST_EQ(bind(sum_of_args_0)(), 0);
+ BOOST_TEST_EQ(bind(sum_of_args_1, _1)(i), 1);
+ BOOST_TEST_EQ(bind(sum_of_args_2, _1, _2)(i, j), 3);
+ BOOST_TEST_EQ(bind(sum_of_args_3, _1, _2, _3)(i, j, k), 6);
+ BOOST_TEST_EQ(bind(sum_of_args_4, _1, _2, _3, 4)(i, j, k), 10);
+ BOOST_TEST_EQ(bind(sum_of_args_5, _1, _2, _3, 4, 5)(i, j, k), 15);
+ BOOST_TEST_EQ(bind(sum_of_args_6, _1, _2, _3, 4, 5, 6)(i, j, k), 21);
+ BOOST_TEST_EQ(bind(sum_of_args_7, _1, _2, _3, 4, 5, 6, 7)(i, j, k), 28);
+ BOOST_TEST_EQ(bind(sum_of_args_8, _1, _2, _3, 4, 5, 6, 7, 8)(i, j, k), 36);
+ BOOST_TEST_EQ(bind(sum_of_args_9, _1, _2, _3, 4, 5, 6, 7, 8, 9)(i, j, k), 45);
+
+ // function compositions with bind
+ BOOST_TEST_EQ(bind(sum_of_args_3, bind(sum_of_args_2, _1, 2), 2, 3)(i), 8);
+ BOOST_TEST_EQ(
+ bind(sum_of_args_9,
+ bind(sum_of_args_0), // 0
+ bind(sum_of_args_1, _1), // 1
+ bind(sum_of_args_2, _1, _2), // 3
+ bind(sum_of_args_3, _1, _2, _3), // 6
+ bind(sum_of_args_4, _1, _2, _3, 4), // 10
+ bind(sum_of_args_5, _1, _2, _3, 4, 5), // 15
+ bind(sum_of_args_6, _1, _2, _3, 4, 5, 6), // 21
+ bind(sum_of_args_7, _1, _2, _3, 4, 5, 6, 7), // 28
+ bind(sum_of_args_8, _1, _2, _3, 4, 5, 6, 7, 8) // 36
+ )(i, j, k), 120);
+
+ // deeper nesting
+ result =
+ bind(sum_of_args_1, // 12
+ bind(sum_of_args_4, // 12
+ bind(sum_of_args_2, // 3
+ bind(sum_of_args_1, // 1
+ bind(sum_of_args_1, _1) // 1
+ ),
+ _2),
+ _2,
+ _3,
+ 4)
+ )(i, j, k);
+ BOOST_TEST_EQ(result, 12);
+
+ test_member_functions();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/bll_and_function.cpp b/src/boost/libs/phoenix/test/bll_compatibility/bll_and_function.cpp
new file mode 100644
index 000000000..0800400f1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/bll_and_function.cpp
@@ -0,0 +1,62 @@
+// bll_and_function.cpp - The Boost Lambda Library -----------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// test using BLL and boost::function
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/lambda.hpp"
+
+#include "boost/function.hpp"
+
+#include <vector>
+#include <map>
+#include <set>
+#include <string>
+
+
+using namespace boost::lambda;
+
+using namespace std;
+
+void test_function() {
+
+ boost::function<int (int, int)> f;
+ f = _1 + _2;
+
+ BOOST_TEST_EQ(f(1, 2), 3);
+
+ int i=1; int j=2;
+ boost::function<int& (int&, int)> g = _1 += _2;
+ g(i, j);
+ BOOST_TEST_EQ(i, 3);
+
+
+
+ int* sum = new int();
+ *sum = 0;
+ boost::function<int& (int)> counter = *sum += _1;
+ counter(5); // ok, sum* = 5;
+ BOOST_TEST_EQ(*sum, 5);
+ delete sum;
+
+ // The next statement would lead to a dangling reference
+ // counter(3); // error, *sum does not exist anymore
+
+}
+
+
+int main()
+{
+ test_function();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/cast_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/cast_test.cpp
new file mode 100644
index 000000000..2fbaa70b6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/cast_test.cpp
@@ -0,0 +1,107 @@
+// cast_tests.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+
+#include "boost/lambda/lambda.hpp"
+
+#include "boost/lambda/casts.hpp"
+
+#include <string>
+
+using namespace boost::lambda;
+using namespace std;
+
+class base {
+ int x;
+public:
+ virtual const char* class_name() const { return "const base"; }
+ virtual const char* class_name() { return "base"; }
+ virtual ~base() {}
+};
+
+class derived : public base {
+ int y[100];
+public:
+ virtual const char* class_name() const { return "const derived"; }
+ virtual const char* class_name() { return "derived"; }
+};
+
+
+
+
+void do_test() {
+
+ derived *p_derived = new derived;
+ base *p_base = new base;
+
+ base *b = NULL;
+ derived *d = NULL;
+
+ (var(b) = ll_static_cast<base *>(p_derived))();
+ (var(d) = ll_static_cast<derived *>(b))();
+
+ BOOST_TEST_CSTR_EQ(b->class_name(), "derived");
+ BOOST_TEST_CSTR_EQ(d->class_name(), "derived");
+
+ (var(b) = ll_dynamic_cast<derived *>(b))();
+ BOOST_TEST_NE(b, static_cast<base *>(NULL));
+ BOOST_TEST_CSTR_EQ(b->class_name(), "derived");
+
+ (var(d) = ll_dynamic_cast<derived *>(p_base))();
+ BOOST_TEST_EQ(d, static_cast<derived *>(NULL));
+
+
+
+ const derived* p_const_derived = p_derived;
+
+ BOOST_TEST_CSTR_EQ(p_const_derived->class_name(), "const derived");
+ (var(d) = ll_const_cast<derived *>(p_const_derived))();
+ BOOST_TEST_CSTR_EQ(d->class_name(), "derived");
+
+ int i = 10;
+ char* cp = reinterpret_cast<char*>(&i);
+
+ int* ip;
+ (var(ip) = ll_reinterpret_cast<int *>(cp))();
+ BOOST_TEST_EQ(*ip, 10);
+
+
+ // typeid
+
+ BOOST_TEST_CSTR_EQ(ll_typeid(d)().name(), typeid(d).name());
+
+
+ // sizeof
+
+ BOOST_TEST_EQ(ll_sizeof(_1)(p_derived), sizeof(p_derived));
+ BOOST_TEST_EQ(ll_sizeof(_1)(*p_derived), sizeof(*p_derived));
+ BOOST_TEST_EQ(ll_sizeof(_1)(p_base), sizeof(p_base));
+ BOOST_TEST_EQ(ll_sizeof(_1)(*p_base), sizeof(*p_base));
+
+ int an_array[100];
+ BOOST_TEST_EQ(ll_sizeof(_1)(an_array), 100 * sizeof(int));
+
+ delete p_derived;
+ delete p_base;
+
+
+}
+
+int main()
+{
+ do_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/constructor_tests.cpp b/src/boost/libs/phoenix/test/bll_compatibility/constructor_tests.cpp
new file mode 100644
index 000000000..d1a165fd9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/constructor_tests.cpp
@@ -0,0 +1,274 @@
+// constructor_tests.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/bind.hpp"
+
+#include "boost/lambda/construct.hpp"
+
+#include <iostream>
+#include <algorithm>
+#include <vector>
+
+#ifdef BOOST_MSVC
+#pragma warning(disable:4512)
+#endif
+
+using namespace boost::lambda;
+namespace bl = boost::lambda;
+
+template<class T>
+bool check_tuple(int n, const T& t)
+{
+ return (t.get_head() == n) && check_tuple(n+1, t.get_tail());
+}
+
+template<class T>
+bool check_tuple(int n, T * t)
+{
+ bool ok = check_tuple(n, *t);
+ delete t;
+ return ok;
+}
+
+template <>
+bool check_tuple(int /*n*/, const null_type& ) { return true; }
+
+
+void constructor_all_lengths()
+{
+ bool ok;
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int> >(),
+ 1)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int> >(),
+ 1, 2)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int> >(),
+ 1, 2, 3)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int, int> >(),
+ 1, 2, 3, 4)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6, 7)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6, 7, 8)()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ bind(constructor<tuple<int, int, int, int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6, 7, 8, 9)()
+ );
+ BOOST_TEST(ok);
+
+}
+
+void new_ptr_all_lengths()
+{
+ bool ok;
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int> >(),
+ 1))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int> >(),
+ 1, 2))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int> >(),
+ 1, 2, 3))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int, int> >(),
+ 1, 2, 3, 4))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6, 7))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6, 7, 8))()
+ );
+ BOOST_TEST(ok);
+
+ ok = check_tuple(
+ 1,
+ (bind(new_ptr<tuple<int, int, int, int, int, int, int, int, int> >(),
+ 1, 2, 3, 4, 5, 6, 7, 8, 9))()
+ );
+ BOOST_TEST(ok);
+
+}
+
+class is_destructor_called {
+ bool& b;
+public:
+ is_destructor_called(bool& bb) : b(bb) { b = false; }
+ ~is_destructor_called() { b = true; }
+};
+
+void test_destructor ()
+{
+ char space[sizeof(is_destructor_called)];
+ bool flag = false;
+
+ is_destructor_called* idc = new(space) is_destructor_called(flag);
+ BOOST_TEST_EQ(flag, false);
+ bind(destructor(), _1)(idc);
+ BOOST_TEST_EQ(flag, true);
+
+ idc = new(space) is_destructor_called(flag);
+ BOOST_TEST_EQ(flag, false);
+ bind(destructor(), _1)(*idc);
+ BOOST_TEST_EQ(flag, true);
+}
+
+
+class count_deletes {
+public:
+ static int count;
+ ~count_deletes() { ++count; }
+};
+
+int count_deletes::count = 0;
+
+void test_news_and_deletes ()
+{
+ int* i[10];
+ std::for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
+ int count_errors = 0;
+
+ std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
+ BOOST_TEST_EQ(count_errors, 0);
+ std::for_each(i, i+10, bind(delete_ptr(), _1));
+
+
+ count_deletes* ct[10];
+ std::for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
+ count_deletes::count = 0;
+ std::for_each(ct, ct+10, bind(delete_ptr(), _1));
+ BOOST_TEST_EQ(count_deletes::count, 10);
+
+}
+
+void test_array_new_and_delete()
+{
+ count_deletes* c;
+ (_1 = bind(new_array<count_deletes>(), 5))(c);
+ count_deletes::count = 0;
+
+ bind(delete_array(), _1)(c);
+ BOOST_TEST_EQ(count_deletes::count, 5);
+}
+
+
+void delayed_construction()
+{
+ std::vector<int> x(3);
+ std::vector<int> y(3);
+
+ std::fill(x.begin(), x.end(), 0);
+ std::fill(y.begin(), y.end(), 1);
+
+ std::vector<std::pair<int, int> > v;
+
+ std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
+ bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
+}
+
+int main()
+{
+ constructor_all_lengths();
+ new_ptr_all_lengths();
+ delayed_construction();
+ test_destructor();
+ test_news_and_deletes();
+ test_array_new_and_delete();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/control_structures.cpp b/src/boost/libs/phoenix/test/bll_compatibility/control_structures.cpp
new file mode 100644
index 000000000..cb345380c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/control_structures.cpp
@@ -0,0 +1,123 @@
+// -- control_structures.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/if.hpp"
+#include "boost/lambda/loops.hpp"
+
+#include <iostream>
+#include <algorithm>
+#include <vector>
+
+using namespace boost;
+
+using boost::lambda::constant;
+using boost::lambda::_1;
+using boost::lambda::_2;
+using boost::lambda::_3;
+using boost::lambda::make_const;
+using boost::lambda::for_loop;
+using boost::lambda::while_loop;
+using boost::lambda::do_while_loop;
+using boost::lambda::if_then;
+using boost::lambda::if_then_else;
+using boost::lambda::if_then_else_return;
+
+// 2 container for_each
+template <class InputIter1, class InputIter2, class Function>
+Function for_each(InputIter1 first, InputIter1 last,
+ InputIter2 first2, Function f) {
+ for ( ; first != last; ++first, ++first2)
+ f(*first, *first2);
+ return f;
+}
+
+void simple_loops() {
+
+ // for loops ---------------------------------------------------------
+ int i;
+ int arithmetic_series = 0;
+ for_loop(_1 = 0, _1 < 10, _1++, arithmetic_series += _1)(i);
+ BOOST_TEST_EQ(arithmetic_series, 45);
+
+ // no body case
+ for_loop(boost::lambda::var(i) = 0, boost::lambda::var(i) < 100, ++boost::lambda::var(i))();
+ BOOST_TEST_EQ(i, 100);
+
+ // while loops -------------------------------------------------------
+ int a = 0, b = 0, c = 0;
+
+ while_loop((_1 + _2) >= (_1 * _2), (++_1, ++_2, ++_3))(a, b, c);
+ BOOST_TEST_EQ(c, 3);
+
+ int count;
+ count = 0; i = 0;
+ while_loop(_1++ < 10, ++boost::lambda::var(count))(i);
+ BOOST_TEST_EQ(count, 10);
+
+ // note that the first parameter of do_while_loop is the condition
+ count = 0; i = 0;
+ do_while_loop(_1++ < 10, ++boost::lambda::var(count))(i);
+ BOOST_TEST_EQ(count, 11);
+
+ a = 0;
+ do_while_loop(constant(false), _1++)(a);
+ BOOST_TEST_EQ(a, 1);
+
+ // no body cases
+ a = 40; b = 30;
+ while_loop(--_1 > _2)(a, b);
+ BOOST_TEST_EQ(a, b);
+
+ // (the no body case for do_while_loop is pretty redundant)
+ a = 40; b = 30;
+ do_while_loop(--_1 > _2)(a, b);
+ BOOST_TEST_EQ(a, b);
+
+
+}
+
+void simple_ifs () {
+
+ int value = 42;
+ if_then(_1 < 0, _1 = 0)(value);
+ BOOST_TEST_EQ(value, 42);
+
+ value = -42;
+ if_then(_1 < 0, _1 = -_1)(value);
+ BOOST_TEST_EQ(value, 42);
+
+ int min;
+ if_then_else(_1 < _2, boost::lambda::var(min) = _1, boost::lambda::var(min) = _2)
+ (make_const(1), make_const(2));
+ BOOST_TEST_EQ(min, 1);
+
+ if_then_else(_1 < _2, boost::lambda::var(min) = _1, boost::lambda::var(min) = _2)
+ (make_const(5), make_const(3));
+ BOOST_TEST_EQ(min, 3);
+
+ int x, y;
+ x = -1; y = 1;
+ BOOST_TEST_EQ(if_then_else_return(_1 < _2, _2, _1)(x, y), (std::max)(x ,y));
+ BOOST_TEST_EQ(if_then_else_return(_1 < _2, _2, _1)(y, x), (std::max)(x ,y));
+}
+
+
+int main()
+{
+ simple_loops();
+ simple_ifs();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/exception_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/exception_test.cpp
new file mode 100644
index 000000000..97d517bba
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/exception_test.cpp
@@ -0,0 +1,613 @@
+// -- exception_test.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/lambda.hpp"
+
+#include "boost/lambda/exceptions.hpp"
+
+#include "boost/lambda/bind.hpp"
+
+#include<iostream>
+#include<algorithm>
+#include <cstdlib>
+
+#include <iostream>
+
+using namespace boost::lambda;
+using namespace std;
+
+// to prevent unused variables warnings
+template <class T> void dummy(const T&) {}
+
+void erroneous_exception_related_lambda_expressions() {
+
+ int i = 0;
+ dummy(i);
+
+ // Uncommenting any of the below code lines should result in a compile
+ // time error
+
+ // this should fail (a rethrow binder outside of catch
+ // rethrow()();
+
+ // this should fail too for the same reason
+ // try_catch(rethrow(), catch_all(cout << constant("Howdy")))();
+
+ // this fails too (_e outside of catch_exception)
+ // (_1 + _2 + _e)(i, i, i);
+
+ // and this (_e outside of catch_exception)
+ // try_catch( throw_exception(1), catch_all(cout << _e));
+
+ // and this (_3 in catch_exception
+ // try_catch( throw_exception(1), catch_exception<int>(cout << _3));
+}
+
+
+class A1 {};
+class A2 {};
+class A3 {};
+class A4 {};
+class A5 {};
+class A6 {};
+class A7 {};
+class A8 {};
+class A9 {};
+
+void throw_AX(int j) {
+ int i = j;
+ switch(i) {
+ case 1: throw A1();
+ case 2: throw A2();
+ case 3: throw A3();
+ case 4: throw A4();
+ case 5: throw A5();
+ case 6: throw A6();
+ case 7: throw A7();
+ case 8: throw A8();
+ case 9: throw A9();
+ }
+}
+
+void test_different_number_of_catch_blocks() {
+
+ int ecount;
+
+// no catch(...) cases
+
+
+ ecount = 0;
+ for(int i=1; i<=1; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 1);
+
+ ecount = 0;
+ for(int i=1; i<=2; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 2);
+
+ ecount = 0;
+ for(int i=1; i<=3; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 3);
+
+ ecount = 0;
+ for(int i=1; i<=4; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 4);
+
+ ecount = 0;
+ for(int i=1; i<=5; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 5);
+
+ ecount = 0;
+ for(int i=1; i<=6; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 6);
+
+ ecount = 0;
+ for(int i=1; i<=7; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ ),
+ catch_exception<A7>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 7);
+
+ ecount = 0;
+ for(int i=1; i<=8; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ ),
+ catch_exception<A7>(
+ var(ecount)++
+ ),
+ catch_exception<A8>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 8);
+
+ ecount = 0;
+ for(int i=1; i<=9; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ ),
+ catch_exception<A7>(
+ var(ecount)++
+ ),
+ catch_exception<A8>(
+ var(ecount)++
+ ),
+ catch_exception<A9>(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 9);
+
+
+ // with catch(...) blocks
+
+ ecount = 0;
+ for(int i=1; i<=1; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 1);
+
+ ecount = 0;
+ for(int i=1; i<=2; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 2);
+
+ ecount = 0;
+ for(int i=1; i<=3; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 3);
+
+ ecount = 0;
+ for(int i=1; i<=4; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 4);
+
+ ecount = 0;
+ for(int i=1; i<=5; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 5);
+
+ ecount = 0;
+ for(int i=1; i<=6; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 6);
+
+ ecount = 0;
+ for(int i=1; i<=7; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 7);
+
+ ecount = 0;
+ for(int i=1; i<=8; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ ),
+ catch_exception<A7>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 8);
+
+ ecount = 0;
+ for(int i=1; i<=9; i++)
+ {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>(
+ var(ecount)++
+ ),
+ catch_exception<A2>(
+ var(ecount)++
+ ),
+ catch_exception<A3>(
+ var(ecount)++
+ ),
+ catch_exception<A4>(
+ var(ecount)++
+ ),
+ catch_exception<A5>(
+ var(ecount)++
+ ),
+ catch_exception<A6>(
+ var(ecount)++
+ ),
+ catch_exception<A7>(
+ var(ecount)++
+ ),
+ catch_exception<A8>(
+ var(ecount)++
+ ),
+ catch_all(
+ var(ecount)++
+ )
+ )(i);
+ }
+ BOOST_TEST_EQ(ecount, 9);
+}
+
+void test_empty_catch_blocks() {
+ try_catch(
+ bind(throw_AX, _1),
+ catch_exception<A1>()
+ )(make_const(1));
+
+ try_catch(
+ bind(throw_AX, _1),
+ catch_all()
+ )(make_const(1));
+
+}
+
+
+void return_type_matching() {
+
+// Rules for return types of the lambda functors in try and catch parts:
+// 1. The try part dictates the return type of the whole
+// try_catch lambda functor
+// 2. If return type of try part is void, catch parts can return anything,
+// but the return types are ignored
+// 3. If the return type of the try part is A, then each catch return type
+// must be implicitly convertible to A, or then it must throw for sure
+
+
+ int i = 1;
+
+ BOOST_TEST_EQ(
+ try_catch(
+ _1 + 1,
+ catch_exception<int>((&_1, rethrow())), // no match, but ok since throws
+ catch_exception<char>(_e) // ok, char convertible to int
+ )(i), 2
+ );
+
+ // note that while e.g. char is convertible to int, it is not convertible
+ // to int&, (some lambda functors return references)
+
+ // try_catch(
+ // _1 += 1,
+ // catch_exception<char>(_e) // NOT ok, char not convertible to int&
+ // )(i);
+
+ // if you don't care about the return type, you can use make_void
+ try_catch(
+ make_void(_1 += 1),
+ catch_exception<char>(_e) // since try is void, catch can return anything
+ )(i);
+ BOOST_TEST_EQ(i, 2);
+
+ try_catch(
+ (_1 += 1, throw_exception('a')),
+ catch_exception<char>(_e) // since try throws, it is void,
+ // so catch can return anything
+ )(i);
+ BOOST_TEST_EQ(i, 3);
+
+ char a = 'a';
+ try_catch(
+ try_catch(
+ throw_exception(1),
+ catch_exception<int>(throw_exception('b'))
+ ),
+ catch_exception<char>( _1 = _e )
+ )(a);
+ BOOST_TEST_EQ(a, 'b');
+}
+
+int main()
+{
+ try
+ {
+ test_different_number_of_catch_blocks();
+ return_type_matching();
+ test_empty_catch_blocks();
+ }
+ catch (int)
+ {
+ BOOST_TEST(false);
+ }
+ catch(...)
+ {
+ BOOST_TEST(false);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/extending_rt_traits.cpp b/src/boost/libs/phoenix/test/bll_compatibility/extending_rt_traits.cpp
new file mode 100644
index 000000000..968fdffb3
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/extending_rt_traits.cpp
@@ -0,0 +1,389 @@
+// extending_return_type_traits.cpp -- The Boost Lambda Library --------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/bind.hpp"
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/detail/suppress_unused.hpp"
+
+#include <iostream>
+
+#include <functional>
+
+#include <algorithm>
+
+using boost::lambda::detail::suppress_unused_variable_warnings;
+
+class A {};
+class B {};
+
+using namespace boost::lambda;
+
+
+B operator--(const A&, int) { return B(); }
+B operator--(A&) { return B(); }
+B operator++(const A&, int) { return B(); }
+B operator++(A&) { return B(); }
+B operator-(const A&) { return B(); }
+B operator+(const A&) { return B(); }
+
+B operator!(const A&) { return B(); }
+
+B operator&(const A&) { return B(); }
+B operator*(const A&) { return B(); }
+
+namespace boost {
+namespace lambda {
+
+ // unary + and -
+template<class Act>
+struct plain_return_type_1<unary_arithmetic_action<Act>, A > {
+ typedef B type;
+};
+
+ // post incr/decr
+template<class Act>
+struct plain_return_type_1<post_increment_decrement_action<Act>, A > {
+ typedef B type;
+};
+
+ // pre incr/decr
+template<class Act>
+struct plain_return_type_1<pre_increment_decrement_action<Act>, A > {
+ typedef B type;
+};
+ // !
+template<>
+struct plain_return_type_1<logical_action<not_action>, A> {
+ typedef B type;
+};
+ // &
+template<>
+struct plain_return_type_1<other_action<addressof_action>, A> {
+ typedef B type;
+};
+ // *
+template<>
+struct plain_return_type_1<other_action<contentsof_action>, A> {
+ typedef B type;
+};
+
+
+} // lambda
+} // boost
+
+void ok(B /*b*/) {}
+
+void test_unary_operators()
+{
+ A a; int i = 1;
+ ok((++_1)(a));
+ ok((--_1)(a));
+ ok((_1++)(a));
+ ok((_1--)(a));
+ ok((+_1)(a));
+ ok((-_1)(a));
+ ok((!_1)(a));
+ ok((&_1)(a));
+ ok((*_1)(a));
+
+ BOOST_TEST_EQ((*_1)(make_const(&i)), 1);
+}
+
+class X {};
+class Y {};
+class Z {};
+
+Z operator+(const X&, const Y&) { return Z(); }
+Z operator-(const X&, const Y&) { return Z(); }
+X operator*(const X&, const Y&) { return X(); }
+
+Z operator/(const X&, const Y&) { return Z(); }
+Z operator%(const X&, const Y&) { return Z(); }
+
+class XX {};
+class YY {};
+class ZZ {};
+class VV {};
+
+// it is possible to support differently cv-qualified versions
+YY operator*(XX&, YY&) { return YY(); }
+ZZ operator*(const XX&, const YY&) { return ZZ(); }
+XX operator*(volatile XX&, volatile YY&) { return XX(); }
+VV operator*(const volatile XX&, const volatile YY&) { return VV(); }
+
+// the traits can be more complex:
+template <class T>
+class my_vector {};
+
+template<class A, class B>
+my_vector<typename return_type_2<arithmetic_action<plus_action>, A&, B&>::type>
+operator+(const my_vector<A>& /*a*/, const my_vector<B>& /*b*/)
+{
+ typedef typename
+ return_type_2<arithmetic_action<plus_action>, A&, B&>::type res_type;
+ return my_vector<res_type>();
+}
+
+
+
+// bitwise ops:
+X operator<<(const X&, const Y&) { return X(); }
+Z operator>>(const X&, const Y&) { return Z(); }
+Z operator&(const X&, const Y&) { return Z(); }
+Z operator|(const X&, const Y&) { return Z(); }
+Z operator^(const X&, const Y&) { return Z(); }
+
+// comparison ops:
+
+X operator<(const X&, const Y&) { return X(); }
+Z operator>(const X&, const Y&) { return Z(); }
+Z operator<=(const X&, const Y&) { return Z(); }
+Z operator>=(const X&, const Y&) { return Z(); }
+Z operator==(const X&, const Y&) { return Z(); }
+Z operator!=(const X&, const Y&) { return Z(); }
+
+// logical
+
+X operator&&(const X&, const Y&) { return X(); }
+Z operator||(const X&, const Y&) { return Z(); }
+
+// arithh assignment
+
+Z operator+=( X&, const Y&) { return Z(); }
+Z operator-=( X&, const Y&) { return Z(); }
+Y operator*=( X&, const Y&) { return Y(); }
+Z operator/=( X&, const Y&) { return Z(); }
+Z operator%=( X&, const Y&) { return Z(); }
+
+// bitwise assignment
+Z operator<<=( X&, const Y&) { return Z(); }
+Z operator>>=( X&, const Y&) { return Z(); }
+Y operator&=( X&, const Y&) { return Y(); }
+Z operator|=( X&, const Y&) { return Z(); }
+Z operator^=( X&, const Y&) { return Z(); }
+
+// assignment
+class Assign {
+public:
+ void operator=(const Assign& /*a*/) {}
+ X operator[](const int& /*i*/) { return X(); }
+};
+
+
+
+namespace boost {
+namespace lambda {
+
+ // you can do action groups
+template<class Act>
+struct plain_return_type_2<arithmetic_action<Act>, X, Y> {
+ typedef Z type;
+};
+
+ // or specialize the exact action
+template<>
+struct plain_return_type_2<arithmetic_action<multiply_action>, X, Y> {
+ typedef X type;
+};
+
+ // if you want to make a distinction between differently cv-qualified
+ // types, you need to specialize on a different level:
+template<>
+struct return_type_2<arithmetic_action<multiply_action>, XX, YY> {
+ typedef YY type;
+};
+template<>
+struct return_type_2<arithmetic_action<multiply_action>, const XX, const YY> {
+ typedef ZZ type;
+};
+template<>
+struct return_type_2<arithmetic_action<multiply_action>, volatile XX, volatile YY> {
+ typedef XX type;
+};
+template<>
+struct return_type_2<arithmetic_action<multiply_action>, volatile const XX, const volatile YY> {
+ typedef VV type;
+};
+
+ // the mapping can be more complex:
+template<class A, class B>
+struct plain_return_type_2<arithmetic_action<plus_action>, my_vector<A>, my_vector<B> > {
+ typedef typename
+ return_type_2<arithmetic_action<plus_action>, A&, B&>::type res_type;
+ typedef my_vector<res_type> type;
+};
+
+ // bitwise binary:
+ // you can do action groups
+template<class Act>
+struct plain_return_type_2<bitwise_action<Act>, X, Y> {
+ typedef Z type;
+};
+
+ // or specialize the exact action
+template<>
+struct plain_return_type_2<bitwise_action<leftshift_action>, X, Y> {
+ typedef X type;
+};
+
+ // comparison binary:
+ // you can do action groups
+template<class Act>
+struct plain_return_type_2<relational_action<Act>, X, Y> {
+ typedef Z type;
+};
+
+ // or specialize the exact action
+template<>
+struct plain_return_type_2<relational_action<less_action>, X, Y> {
+ typedef X type;
+};
+
+ // logical binary:
+ // you can do action groups
+template<class Act>
+struct plain_return_type_2<logical_action<Act>, X, Y> {
+ typedef Z type;
+};
+
+ // or specialize the exact action
+template<>
+struct plain_return_type_2<logical_action<and_action>, X, Y> {
+ typedef X type;
+};
+
+ // arithmetic assignment :
+ // you can do action groups
+template<class Act>
+struct plain_return_type_2<arithmetic_assignment_action<Act>, X, Y> {
+ typedef Z type;
+};
+
+ // or specialize the exact action
+template<>
+struct plain_return_type_2<arithmetic_assignment_action<multiply_action>, X, Y> {
+ typedef Y type;
+};
+
+ // arithmetic assignment :
+ // you can do action groups
+template<class Act>
+struct plain_return_type_2<bitwise_assignment_action<Act>, X, Y> {
+ typedef Z type;
+};
+
+ // or specialize the exact action
+template<>
+struct plain_return_type_2<bitwise_assignment_action<and_action>, X, Y> {
+ typedef Y type;
+};
+
+ // assignment
+template<>
+struct plain_return_type_2<other_action<assignment_action>, Assign, Assign> {
+ typedef void type;
+};
+ // subscript
+template<>
+struct plain_return_type_2<other_action<subscript_action>, Assign, int> {
+ typedef X type;
+};
+
+
+} // end lambda
+} // end boost
+
+
+
+void test_binary_operators() {
+
+ X x; Y y;
+ (_1 + _2)(x, y);
+ (_1 - _2)(x, y);
+ (_1 * _2)(x, y);
+ (_1 / _2)(x, y);
+ (_1 % _2)(x, y);
+
+
+ // make a distinction between differently cv-qualified operators
+ XX xx; YY yy;
+ const XX& cxx = xx;
+ const YY& cyy = yy;
+ volatile XX& vxx = xx;
+ volatile YY& vyy = yy;
+ const volatile XX& cvxx = xx;
+ const volatile YY& cvyy = yy;
+
+ ZZ dummy1 = (_1 * _2)(cxx, cyy);
+ YY dummy2 = (_1 * _2)(xx, yy);
+ XX dummy3 = (_1 * _2)(vxx, vyy);
+ VV dummy4 = (_1 * _2)(cvxx, cvyy);
+
+ suppress_unused_variable_warnings(dummy1);
+ suppress_unused_variable_warnings(dummy2);
+ suppress_unused_variable_warnings(dummy3);
+ suppress_unused_variable_warnings(dummy4);
+
+ my_vector<int> v1; my_vector<double> v2;
+ my_vector<double> d = (_1 + _2)(v1, v2);
+
+ suppress_unused_variable_warnings(d);
+
+ // bitwise
+
+ (_1 << _2)(x, y);
+ (_1 >> _2)(x, y);
+ (_1 | _2)(x, y);
+ (_1 & _2)(x, y);
+ (_1 ^ _2)(x, y);
+
+ // comparison
+
+ (_1 < _2)(x, y);
+ (_1 > _2)(x, y);
+ (_1 <= _2)(x, y);
+ (_1 >= _2)(x, y);
+ (_1 == _2)(x, y);
+ (_1 != _2)(x, y);
+
+ // logical
+
+ (_1 || _2)(x, y);
+ (_1 && _2)(x, y);
+
+ // arithmetic assignment
+ (_1 += _2)(x, y);
+ (_1 -= _2)(x, y);
+ (_1 *= _2)(x, y);
+ (_1 /= _2)(x, y);
+ (_1 %= _2)(x, y);
+
+ // bitwise assignment
+ (_1 <<= _2)(x, y);
+ (_1 >>= _2)(x, y);
+ (_1 |= _2)(x, y);
+ (_1 &= _2)(x, y);
+ (_1 ^= _2)(x, y);
+
+}
+
+
+int main()
+{
+ test_unary_operators();
+ test_binary_operators();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/is_instance_of_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/is_instance_of_test.cpp
new file mode 100644
index 000000000..605ede2f2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/is_instance_of_test.cpp
@@ -0,0 +1,78 @@
+// is_instance_of_test.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+
+#include "boost/lambda/detail/is_instance_of.hpp"
+
+#include <iostream>
+
+template <class T1> struct A1 {};
+template <class T1, class T2> struct A2 {};
+template <class T1, class T2, class T3> struct A3 {};
+template <class T1, class T2, class T3, class T4> struct A4 {};
+
+class B1 : public A1<int> {};
+class B2 : public A2<int,int> {};
+class B3 : public A3<int,int,int> {};
+class B4 : public A4<int,int,int,int> {};
+
+// classes that are convertible to classes that derive from A instances
+// This is not enough to make the test succeed
+
+class C1 { public: operator A1<int>() { return A1<int>(); } };
+class C2 { public: operator B2() { return B2(); } };
+class C3 { public: operator B3() { return B3(); } };
+class C4 { public: operator B4() { return B4(); } };
+
+// test that the result is really a constant
+// (in an alternative implementation, gcc 3.0.2. claimed that it was
+// a non-constant)
+template <bool b> class X {};
+// this should compile
+X<boost::lambda::is_instance_of_2<int, A2>::value> x;
+
+
+int main()
+{
+ using boost::lambda::is_instance_of_1;
+ using boost::lambda::is_instance_of_2;
+ using boost::lambda::is_instance_of_3;
+ using boost::lambda::is_instance_of_4;
+
+
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_1<B1, A1>));
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_1<A1<float>, A1>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_1<int, A1>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_1<C1, A1>));
+
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_2<B2, A2>));
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_2<A2<int, float>, A2>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_2<int, A2>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_2<C2, A2>));
+
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_3<B3, A3>));
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_3<A3<int, float, char>, A3>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_3<int, A3>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_3<C3, A3>));
+
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_4<B4, A4>));
+ BOOST_TEST_TRAIT_TRUE((is_instance_of_4<A4<int, float, char, double>, A4>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_4<int, A4>));
+ BOOST_TEST_TRAIT_FALSE((is_instance_of_4<C4, A4>));
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/istreambuf_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/istreambuf_test.cpp
new file mode 100644
index 000000000..6db0842cf
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/istreambuf_test.cpp
@@ -0,0 +1,30 @@
+// istreambuf_test - test lambda function objects with istreambuf_iterator
+//
+// Copyright (c) 2007 Peter Dimov
+//
+// 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/lambda/lambda.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <iterator>
+#include <sstream>
+#include <algorithm>
+
+int main()
+{
+ using namespace boost::lambda;
+
+ std::stringstream is( "ax2" );
+
+ std::istreambuf_iterator<char> b2( is );
+ std::istreambuf_iterator<char> e2;
+
+ std::istreambuf_iterator<char> i = std::find_if( b2, e2, _1 == 'x' );
+
+ BOOST_TEST( *i == 'x' );
+ BOOST_TEST( std::distance( i, e2 ) == 2 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/member_pointer_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/member_pointer_test.cpp
new file mode 100644
index 000000000..2bdcf199b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/member_pointer_test.cpp
@@ -0,0 +1,193 @@
+// member_pointer_test.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/bind.hpp"
+
+#include <string>
+
+using namespace boost::lambda;
+using namespace std;
+
+
+struct my_struct {
+my_struct(int x) : mem(x) {};
+
+ int mem;
+
+ int fooc() const { return mem; }
+ int foo() { return mem; }
+ int foo1c(int y) const { return y + mem; }
+ int foo1(int y) { return y + mem; }
+ int foo2c(int y, int x) const { return y + x + mem; }
+ int foo2(int y, int x) { return y + x + mem; }
+ int foo3c(int y, int x, int z) const { return y + x + z + mem; }
+ int foo3(int y, int x, int z ){ return y + x + z + mem; }
+ int foo4c(int a1, int a2, int a3, int a4) const { return a1+a2+a3+a4+mem; }
+ int foo4(int a1, int a2, int a3, int a4){ return a1+a2+a3+a4+mem; }
+
+ int foo3default(int y = 1, int x = 2, int z = 3) { return y + x + z + mem; }
+};
+
+my_struct x(3);
+
+void pointer_to_data_member_tests() {
+
+ // int i = 0;
+ my_struct *y = &x;
+
+ BOOST_TEST_EQ((_1 ->* &my_struct::mem)(y), 3);
+
+ (_1 ->* &my_struct::mem)(y) = 4;
+ BOOST_TEST_EQ(x.mem, 4);
+
+ ((_1 ->* &my_struct::mem) = 5)(y);
+ BOOST_TEST_EQ(x.mem, 5);
+
+ // &my_struct::mem is a temporary, must be constified
+ ((y ->* _1) = 6)(make_const(&my_struct::mem));
+ BOOST_TEST_EQ(x.mem, 6);
+
+ ((_1 ->* _2) = 7)(y, make_const(&my_struct::mem));
+ BOOST_TEST_EQ(x.mem, 7);
+
+}
+
+void pointer_to_member_function_tests() {
+
+ my_struct *y = new my_struct(1);
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo)(y)(), (y->mem));
+ BOOST_TEST_EQ( (_1 ->* &my_struct::fooc)(y)(), (y->mem));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo))(), (y->mem));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::fooc))(), (y->mem));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo))(), (y->mem));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::fooc))(), (y->mem));
+
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo1)(y)(1), (y->mem+1));
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo1c)(y)(1), (y->mem+1));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo1))(1), (y->mem+1));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo1c))(1), (y->mem+1));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo1))(1), (y->mem+1));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo1c))(1), (y->mem+1));
+
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo2)(y)(1,2), (y->mem+1+2));
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo2c)(y)(1,2), (y->mem+1+2));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo2))(1,2), (y->mem+1+2));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo2c))(1,2), (y->mem+1+2));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo2))(1,2), (y->mem+1+2));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo2c))(1,2), (y->mem+1+2));
+
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo3)(y)(1,2,3), (y->mem+1+2+3));
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo3c)(y)(1,2,3), (y->mem+1+2+3));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo3))(1,2,3), (y->mem+1+2+3));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo3c))(1,2,3), (y->mem+1+2+3));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo3))(1,2,3), (y->mem+1+2+3));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo3c))(1,2,3), (y->mem+1+2+3));
+
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo4)(y)(1,2,3,4), (y->mem+1+2+3+4));
+ BOOST_TEST_EQ( (_1 ->* &my_struct::foo4c)(y)(1,2,3,4), (y->mem+1+2+3+4));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo4))(1,2,3,4), (y->mem+1+2+3+4));
+ BOOST_TEST_EQ( (y ->* _1)(make_const(&my_struct::foo4c))(1,2,3,4), (y->mem+1+2+3+4));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo4))(1,2,3,4), (y->mem+1+2+3+4));
+ BOOST_TEST_EQ( (_1 ->* _2)(y, make_const(&my_struct::foo4c))(1,2,3,4), (y->mem+1+2+3+4));
+
+
+
+ // member functions with default values do not work (inherent language issue)
+ // BOOST_TEST_EQ( (_1 ->* &my_struct::foo3default)(y)(), (y->mem+1+2+3));
+
+ delete y;
+
+}
+
+class A {};
+class B {};
+class C {};
+class D {};
+
+// ->* can be overloaded to do anything
+bool operator->*(A /*a*/, B /*b*/) {
+ return false;
+}
+
+bool operator->*(B /*b*/, A /*a*/) {
+ return true;
+}
+
+// let's provide specializations to take care of the return type deduction.
+// Note, that you need to provide all four cases for non-const and const
+// or use the plain_return_type_2 template.
+namespace boost {
+namespace lambda {
+
+template <>
+struct return_type_2<other_action<member_pointer_action>, B, A> {
+ typedef bool type;
+};
+
+template<>
+struct return_type_2<other_action<member_pointer_action>, const B, A> {
+ typedef bool type;
+};
+
+template<>
+struct return_type_2<other_action<member_pointer_action>, B, const A> {
+ typedef bool type;
+};
+
+template<>
+struct return_type_2<other_action<member_pointer_action>, const B, const A> {
+ typedef bool type;
+};
+
+
+
+
+} // lambda
+} // boost
+
+void test_overloaded_pointer_to_member()
+{
+ A a; B b;
+
+ // this won't work, can't deduce the return type
+ // BOOST_TEST_EQ((_1->*_2)(a, b), false);
+
+ // ret<bool> gives the return type
+ BOOST_TEST_EQ(ret<bool>(_1->*_2)(a, b), false);
+ BOOST_TEST_EQ(ret<bool>(a->*_1)(b), false);
+ BOOST_TEST_EQ(ret<bool>(_1->*b)(a), false);
+ BOOST_TEST_EQ((ret<bool>((var(a))->*b))(), false);
+ BOOST_TEST_EQ((ret<bool>((var(a))->*var(b)))(), false);
+
+
+ // this is ok without ret<bool> due to the return_type_2 spcialization above
+ BOOST_TEST_EQ((_1->*_2)(b, a), true);
+ BOOST_TEST_EQ((b->*_1)(a), true);
+ BOOST_TEST_EQ((_1->*a)(b), true);
+ BOOST_TEST_EQ((var(b)->*a)(), true);
+ return;
+}
+
+
+int main()
+{
+ pointer_to_data_member_tests();
+ pointer_to_member_function_tests();
+ test_overloaded_pointer_to_member();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/operator_tests_simple.cpp b/src/boost/libs/phoenix/test/bll_compatibility/operator_tests_simple.cpp
new file mode 100644
index 000000000..8a5335154
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/operator_tests_simple.cpp
@@ -0,0 +1,425 @@
+// operator_tests_simple.cpp -- The Boost Lambda Library ---------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/lambda.hpp"
+
+#include "boost/lambda/detail/suppress_unused.hpp"
+
+#include <boost/shared_ptr.hpp>
+
+#include <vector>
+#include <map>
+#include <set>
+#include <string>
+
+#include <iostream>
+
+#ifndef BOOST_NO_STRINGSTREAM
+#include <sstream>
+#endif
+
+using namespace std;
+using namespace boost;
+
+using namespace boost::lambda;
+
+
+class unary_plus_tester {};
+unary_plus_tester operator+(const unary_plus_tester& a) { return a; }
+
+void cout_tests()
+{
+#ifndef BOOST_NO_STRINGSTREAM
+ using std::cout;
+ ostringstream os;
+ int i = 10;
+ (os << _1)(i);
+
+ (os << constant("FOO"))();
+
+ BOOST_TEST_EQ(os.str(), std::string("10FOO"));
+
+
+ istringstream is("ABC 1");
+ std::string s;
+ int k;
+
+ is >> s;
+ is >> k;
+
+ BOOST_TEST_EQ(s, std::string("ABC"));
+ BOOST_TEST_EQ(k, 1);
+ // test for constant, constant_ref and var
+ i = 5;
+ constant_type<int>::type ci(constant(i));
+ var_type<int>::type vi(var(i));
+
+ (vi = _1)(make_const(100));
+ BOOST_TEST_EQ((ci)(), 5);
+ BOOST_TEST_EQ(i, 100);
+
+ int a;
+ constant_ref_type<int>::type cr(constant_ref(i));
+ (++vi, var(a) = cr)();
+ BOOST_TEST_EQ(i, 101);
+#endif
+}
+
+void arithmetic_operators() {
+ int i = 1; int j = 2; int k = 3;
+
+ using namespace std;
+ using namespace boost::lambda;
+
+ BOOST_TEST_EQ((_1 + 1)(i), 2);
+ BOOST_TEST_EQ(((_1 + 1) * _2)(i, j), 4);
+ BOOST_TEST_EQ((_1 - 1)(i), 0);
+
+ BOOST_TEST_EQ((_1 * 2)(j), 4);
+ BOOST_TEST_EQ((_1 / 2)(j), 1);
+
+ BOOST_TEST_EQ((_1 % 2)(k), 1);
+
+ BOOST_TEST_EQ((-_1)(i), -1);
+ BOOST_TEST_EQ((+_1)(i), 1);
+
+ // test that unary plus really does something
+ unary_plus_tester u;
+ unary_plus_tester up = (+_1)(u);
+
+ boost::lambda::detail::suppress_unused_variable_warnings(up);
+}
+
+void bitwise_operators() {
+ unsigned int ui = 2;
+
+ BOOST_TEST_EQ((_1 << 1)(ui), (2 << 1));
+ BOOST_TEST_EQ((_1 >> 1)(ui), (2 >> 1));
+
+ BOOST_TEST_EQ((_1 & 1)(ui), (2 & 1));
+ BOOST_TEST_EQ((_1 | 1)(ui), (2 | 1));
+ BOOST_TEST_EQ((_1 ^ 1)(ui), (2 ^ 1));
+ BOOST_TEST_EQ((~_1)(ui), ~2u);
+}
+
+void comparison_operators() {
+ int i = 0, j = 1;
+
+ BOOST_TEST((_1 < _2)(i, j));
+ BOOST_TEST((_1 <= _2)(i, j));
+ BOOST_TEST(!(_1 == _2)(i, j));
+ BOOST_TEST((_1 != _2)(i, j));
+ BOOST_TEST(!(_1 > _2)(i, j));
+ BOOST_TEST(!(_1 >= _2)(i, j));
+
+ BOOST_TEST(!(!(_1 < _2))(i, j));
+ BOOST_TEST(!(!(_1 <= _2))(i, j));
+ BOOST_TEST((!(_1 == _2))(i, j));
+ BOOST_TEST(!(!(_1 != _2))(i, j));
+ BOOST_TEST((!(_1 > _2))(i, j));
+ BOOST_TEST((!(_1 >= _2))(i, j));
+}
+
+void logical_operators() {
+
+ bool t = true, f = false;
+ BOOST_TEST((_1 && _2)(t, t));
+ BOOST_TEST(!(_1 && _2)(t, f));
+ BOOST_TEST(!(_1 && _2)(f, t));
+ BOOST_TEST(!(_1 && _2)(f, f));
+
+ BOOST_TEST((_1 || _2)(t, t));
+ BOOST_TEST((_1 || _2)(t, f));
+ BOOST_TEST((_1 || _2)(f, t));
+ BOOST_TEST(!(_1 || _2)(f, f));
+
+ BOOST_TEST(!(!_1)(t));
+ BOOST_TEST((!_1)(f));
+
+ // test short circuiting
+ int i=0;
+
+ (false && ++_1)(i);
+ BOOST_TEST_EQ(i, 0);
+ i = 0;
+
+ (true && ++_1)(i);
+ BOOST_TEST_EQ(i, 1);
+ i = 0;
+
+ (false || ++_1)(i);
+ BOOST_TEST_EQ(i, 1);
+ i = 0;
+
+ (true || ++_1)(i);
+ BOOST_TEST_EQ(i, 0);
+ i = 0;
+}
+
+void unary_incs_and_decs() {
+ int i = 0;
+
+ BOOST_TEST_EQ(_1++(i), 0);
+ BOOST_TEST_EQ(i, 1);
+ i = 0;
+
+ BOOST_TEST_EQ(_1--(i), 0);
+ BOOST_TEST_EQ(i, -1);
+ i = 0;
+
+ BOOST_TEST_EQ((++_1)(i), 1);
+ BOOST_TEST_EQ(i, 1);
+ i = 0;
+
+ BOOST_TEST_EQ((--_1)(i), -1);
+ BOOST_TEST_EQ(i, -1);
+ i = 0;
+
+ // the result of prefix -- and ++ are lvalues
+ (++_1)(i) = 10;
+ BOOST_TEST_EQ(i, 10);
+ i = 0;
+
+ (--_1)(i) = 10;
+ BOOST_TEST_EQ(i, 10);
+ i = 0;
+}
+
+void compound_operators() {
+
+ int i = 1;
+
+ // normal variable as the left operand
+ (i += _1)(make_const(1));
+ BOOST_TEST_EQ(i, 2);
+
+ (i -= _1)(make_const(1));
+ BOOST_TEST_EQ(i, 1);
+
+ (i *= _1)(make_const(10));
+ BOOST_TEST_EQ(i, 10);
+
+ (i /= _1)(make_const(2));
+ BOOST_TEST_EQ(i, 5);
+
+ (i %= _1)(make_const(2));
+ BOOST_TEST_EQ(i, 1);
+
+ // lambda expression as a left operand
+ (_1 += 1)(i);
+ BOOST_TEST_EQ(i, 2);
+
+ (_1 -= 1)(i);
+ BOOST_TEST_EQ(i, 1);
+
+ (_1 *= 10)(i);
+ BOOST_TEST_EQ(i, 10);
+
+ (_1 /= 2)(i);
+ BOOST_TEST_EQ(i, 5);
+
+ (_1 %= 2)(i);
+ BOOST_TEST_EQ(i, 1);
+
+ // lambda expression as a left operand with rvalue on RHS
+ (_1 += (0 + 1))(i);
+ BOOST_TEST_EQ(i, 2);
+
+ (_1 -= (0 + 1))(i);
+ BOOST_TEST_EQ(i, 1);
+
+ (_1 *= (0 + 10))(i);
+ BOOST_TEST_EQ(i, 10);
+
+ (_1 /= (0 + 2))(i);
+ BOOST_TEST_EQ(i, 5);
+
+ (_1 %= (0 + 2))(i);
+ BOOST_TEST_EQ(i, 1);
+
+ // shifts
+ unsigned int ui = 2;
+ (_1 <<= 1)(ui);
+ BOOST_TEST_EQ(ui, (2 << 1));
+
+ ui = 2;
+ (_1 >>= 1)(ui);
+ BOOST_TEST_EQ(ui, (2 >> 1));
+
+ ui = 2;
+ (ui <<= _1)(make_const(1));
+ BOOST_TEST_EQ(ui, (2 << 1));
+
+ ui = 2;
+ (ui >>= _1)(make_const(1));
+ BOOST_TEST_EQ(ui, (2 >> 1));
+
+ // and, or, xor
+ ui = 2;
+ (_1 &= 1)(ui);
+ BOOST_TEST_EQ(ui, (2 & 1));
+
+ ui = 2;
+ (_1 |= 1)(ui);
+ BOOST_TEST_EQ(ui, (2 | 1));
+
+ ui = 2;
+ (_1 ^= 1)(ui);
+ BOOST_TEST_EQ(ui, (2 ^ 1));
+
+ ui = 2;
+ (ui &= _1)(make_const(1));
+ BOOST_TEST_EQ(ui, (2 & 1));
+
+ ui = 2;
+ (ui |= _1)(make_const(1));
+ BOOST_TEST_EQ(ui, (2 | 1));
+
+ ui = 2;
+ (ui ^= _1)(make_const(1));
+ BOOST_TEST_EQ(ui, (2 ^ 1));
+
+}
+
+void assignment_and_subscript() {
+
+ // assignment and subscript need to be defined as member functions.
+ // Hence, if you wish to use a normal variable as the left hand argument,
+ // you must wrap it with var to turn it into a lambda expression
+
+ using std::string;
+ string s;
+
+ (_1 = "one")(s);
+ BOOST_TEST_EQ(s, string("one"));
+
+ (var(s) = "two")();
+ BOOST_TEST_EQ(s, string("two"));
+
+ BOOST_TEST_EQ((var(s)[_1])(make_const(2)), 'o');
+ BOOST_TEST_EQ((_1[2])(s), 'o');
+ BOOST_TEST_EQ((_1[_2])(s, make_const(2)), 'o');
+
+ // subscript returns lvalue
+ (var(s)[_1])(make_const(1)) = 'o';
+ BOOST_TEST_EQ(s, "too");
+
+ (_1[1])(s) = 'a';
+ BOOST_TEST_EQ(s, "tao");
+
+ (_1[_2])(s, make_const(0)) = 'm';
+ BOOST_TEST_EQ(s, "mao");
+
+ // TODO: tests for vector, set, map, multimap
+}
+
+class A {};
+
+void address_of_and_dereference() {
+
+ A a; int i = 42;
+
+ BOOST_TEST_EQ((&_1)(a), &a);
+ BOOST_TEST_EQ((*&_1)(i), 42);
+
+ std::vector<int> vi; vi.push_back(1);
+ std::vector<int>::iterator it = vi.begin();
+
+ (*_1 = 7)(it);
+ BOOST_TEST_EQ(vi[0], 7);
+ const std::vector<int>::iterator cit(it);
+ (*_1 = 8)(cit);
+ BOOST_TEST_EQ(vi[0], 8);
+
+ // TODO: Add tests for more complex iterator types
+
+ boost::shared_ptr<int> ptr(new int(0));
+ (*_1 = 7)(ptr);
+ BOOST_TEST_EQ(*ptr, 7);
+ const boost::shared_ptr<int> cptr(ptr);
+ (*_1 = 8)(cptr);
+ BOOST_TEST_EQ(*ptr, 8);
+}
+
+
+
+void comma() {
+
+ int i = 100;
+ BOOST_TEST_EQ((_1 = 10, 2 * _1)(i), 20);
+
+ // TODO: that the return type is the exact type of the right argument
+ // (that r/l valueness is preserved)
+
+}
+
+void pointer_arithmetic() {
+
+ int ia[4] = { 1, 2, 3, 4 };
+ int* ip = ia;
+ int* ia_last = &ia[3];
+
+ const int cia[4] = { 1, 2, 3, 4 };
+ const int* cip = cia;
+ const int* cia_last = &cia[3];
+
+
+ // non-const array
+ BOOST_TEST_EQ((*(_1 + 1))(ia), 2);
+
+ // non-const pointer
+ BOOST_TEST_EQ((*(_1 + 1))(ip), 2);
+
+ BOOST_TEST_EQ((*(_1 - 1))(ia_last), 3);
+
+ // const array
+ BOOST_TEST_EQ((*(_1 + 1))(cia), 2);
+ // const pointer
+ BOOST_TEST_EQ((*(_1 + 1))(cip), 2);
+ BOOST_TEST_EQ((*(_1 - 1))(cia_last), 3);
+
+ // pointer arithmetic should not make non-consts const
+ (*(_1 + 2))(ia) = 0;
+ (*(_1 + 3))(ip) = 0;
+
+ BOOST_TEST_EQ(ia[2], 0);
+ BOOST_TEST_EQ(ia[3], 0);
+
+ // pointer - pointer
+ BOOST_TEST_EQ((_1 - _2)(ia_last, ia), 3);
+ BOOST_TEST_EQ((_1 - _2)(cia_last, cia), 3);
+ BOOST_TEST_EQ((ia_last - _1)(ia), 3);
+ BOOST_TEST_EQ((cia_last - _1)(cia), 3);
+ BOOST_TEST_EQ((cia_last - _1)(cip), 3);
+
+}
+
+int main()
+{
+ arithmetic_operators();
+ bitwise_operators();
+ comparison_operators();
+ logical_operators();
+ unary_incs_and_decs();
+ compound_operators();
+ assignment_and_subscript();
+ address_of_and_dereference();
+ comma();
+ pointer_arithmetic();
+ cout_tests();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/phoenix_control_structures.cpp b/src/boost/libs/phoenix/test/bll_compatibility/phoenix_control_structures.cpp
new file mode 100644
index 000000000..1aa25ad52
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/phoenix_control_structures.cpp
@@ -0,0 +1,148 @@
+// phoenix_style_control_structures.cpp -- The Boost Lambda Library ------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/if.hpp"
+#include "boost/lambda/loops.hpp"
+
+#include <iostream>
+#include <vector>
+#include <list>
+#include <algorithm>
+#include <cmath>
+#include <cassert>
+#include <functional>
+
+
+
+using namespace boost::lambda;
+using namespace std;
+
+
+
+// If-else, while, do-while, for statements
+
+
+int main()
+{
+ vector<int> v;
+ v.clear();
+ v.push_back(1);
+ v.push_back(2);
+ v.push_back(3);
+ v.push_back(4);
+ v.push_back(5);
+ v.push_back(6);
+ v.push_back(7);
+ v.push_back(8);
+ v.push_back(9);
+ v.push_back(10);
+
+ int sum = 0;
+ //////////////////////////////////
+ for_each(v.begin(), v.end(),
+ if_(_1 > 3 && _1 <= 8)
+ [
+ sum += _1
+ ]
+ );
+
+ BOOST_TEST_EQ(sum, 4+5+6+7+8);
+
+ int gt = 0, eq = 0, lt = 0;
+ //////////////////////////////////
+ for_each(v.begin(), v.end(),
+ if_(_1 > 5)
+ [
+ ++var(gt)
+ ]
+ .else_
+ [
+ if_(_1 == 5)
+ [
+ ++var(eq)
+ ]
+ .else_
+ [
+ ++var(lt)
+ ]
+ ]
+ );
+
+ BOOST_TEST_EQ(lt, 4);
+ BOOST_TEST_EQ(eq, 1);
+ BOOST_TEST_EQ(gt, 5);
+
+ vector<int> t = v;
+
+ int counta = 0;
+ int countb = 0;
+ //////////////////////////////////
+ for_each(v.begin(), v.end(),
+ (
+ while_(_1--)
+ [
+ ++var(counta)
+ ],
+ ++var(countb)
+ )
+ );
+
+ BOOST_TEST_EQ(counta, 55);
+ BOOST_TEST_EQ(countb, 10);
+
+
+ v = t;
+
+ counta = 0; countb = 0;
+ //////////////////////////////////
+ for_each(v.begin(), v.end(),
+ (
+ do_
+ [
+ ++var(counta)
+ ]
+ .while_(_1--),
+ ++var(countb)
+ )
+ );
+
+ BOOST_TEST_EQ(counta, (2+11)*10/2);
+ BOOST_TEST_EQ(countb, 10);
+
+
+ v = t;
+ counta = 0; countb = 0;
+ //////////////////////////////////
+ int iii;
+ for_each(v.begin(), v.end(),
+ (
+ for_(var(iii) = 0, var(iii) < _1, ++var(iii))
+ [
+ ++var(counta)
+ ],
+ ++var(countb)
+ )
+ );
+
+ BOOST_TEST_EQ(counta, (1+10)*10/2);
+ BOOST_TEST_EQ(countb, 10);
+
+ v = t;
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/result_of_tests.cpp b/src/boost/libs/phoenix/test/bll_compatibility/result_of_tests.cpp
new file mode 100644
index 000000000..6213c0d9b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/result_of_tests.cpp
@@ -0,0 +1,315 @@
+// result_of_tests.cpp -- The Boost Lambda Library ------------------
+//
+// Copyright (C) 2010 Steven Watanabe
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+#include <boost/lambda/bind.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+struct with_result_type {
+ typedef int result_type;
+ int operator()() const { return 0; }
+ int operator()(int) const { return 1; }
+ int operator()(int, int) const { return 2; }
+ int operator()(int, int, int) const { return 3; }
+ int operator()(int, int, int, int) const { return 4; }
+ int operator()(int, int, int, int, int) const { return 5; }
+ int operator()(int, int, int, int, int, int) const { return 6; }
+ int operator()(int, int, int, int, int, int, int) const { return 7; }
+ int operator()(int, int, int, int, int, int, int, int) const { return 8; }
+ int operator()(int, int, int, int, int, int, int, int, int) const { return 9; }
+};
+
+struct with_result_template_value {
+ template<class Sig>
+ struct result;
+ template<class This>
+ struct result<This()> {
+ typedef int type;
+ };
+ template<class This, class A1>
+ struct result<This(A1)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2>
+ struct result<This(A1, A2)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3>
+ struct result<This(A1, A2, A3)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4>
+ struct result<This(A1, A2, A3, A4)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5>
+ struct result<This(A1, A2, A3, A4, A5)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6>
+ struct result<This(A1, A2, A3, A4, A5, A6)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ struct result<This(A1, A2, A3, A4, A5, A6, A7)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A7, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ struct result<This(A1, A2, A3, A4, A5, A6, A7, A8)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A7, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A8, int>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ struct result<This(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A7, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A8, int>));
+ BOOST_MPL_ASSERT((boost::is_same<A9, int>));
+ typedef int type;
+ };
+
+ int operator()() const { return 0; }
+ int operator()(int) const { return 1; }
+ int operator()(int, int) const { return 2; }
+ int operator()(int, int, int) const { return 3; }
+ int operator()(int, int, int, int) const { return 4; }
+ int operator()(int, int, int, int, int) const { return 5; }
+ int operator()(int, int, int, int, int, int) const { return 6; }
+ int operator()(int, int, int, int, int, int, int) const { return 7; }
+ int operator()(int, int, int, int, int, int, int, int) const { return 8; }
+ int operator()(int, int, int, int, int, int, int, int, int) const { return 9; }
+};
+
+struct with_result_template_reference {
+ template<class Sig>
+ struct result;
+ template<class This>
+ struct result<This()> {
+ typedef int type;
+ };
+ template<class This, class A1>
+ struct result<This(A1)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2>
+ struct result<This(A1, A2)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3>
+ struct result<This(A1, A2, A3)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4>
+ struct result<This(A1, A2, A3, A4)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5>
+ struct result<This(A1, A2, A3, A4, A5)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6>
+ struct result<This(A1, A2, A3, A4, A5, A6)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ struct result<This(A1, A2, A3, A4, A5, A6, A7)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A7, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ struct result<This(A1, A2, A3, A4, A5, A6, A7, A8)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A7, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A8, int&>));
+ typedef int type;
+ };
+ template<class This, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ struct result<This(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ BOOST_MPL_ASSERT((boost::is_same<A1, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A2, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A3, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A4, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A5, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A6, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A7, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A8, int&>));
+ BOOST_MPL_ASSERT((boost::is_same<A9, int&>));
+ typedef int type;
+ };
+
+ int operator()() const { return 0; }
+ int operator()(int) const { return 1; }
+ int operator()(int, int) const { return 2; }
+ int operator()(int, int, int) const { return 3; }
+ int operator()(int, int, int, int) const { return 4; }
+ int operator()(int, int, int, int, int) const { return 5; }
+ int operator()(int, int, int, int, int, int) const { return 6; }
+ int operator()(int, int, int, int, int, int, int) const { return 7; }
+ int operator()(int, int, int, int, int, int, int, int) const { return 8; }
+ int operator()(int, int, int, int, int, int, int, int, int) const { return 9; }
+};
+
+template<class F>
+typename boost::result_of<F()>::type apply0(F f) {
+ return f();
+}
+template<class A, class F>
+typename boost::result_of<F(A)>::type apply1(F f, A a) {
+ return f(a);
+}
+template<class A, class B, class F>
+typename boost::result_of<F(A, B)>::type apply2(F f, A a, B b) {
+ return f(a, b);
+}
+template<class A, class B, class C, class F>
+typename boost::result_of<F(A, B, C)>::type apply3(F f, A a, B b, C c) {
+ return f(a, b, c);
+}
+
+using namespace boost::lambda;
+
+int main()
+{
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type())(), 0);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1)(), 1);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2)(), 2);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3)(), 3);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3, 4)(), 4);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5)(), 5);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6)(), 6);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6, 7)(), 7);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6, 7, 8)(), 8);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6, 7, 8, 9)(), 9);
+
+ // Nullary result_of fails
+ //BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value())(), 0);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1)(), 1);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2)(), 2);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3)(), 3);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4)(), 4);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5)(), 5);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6)(), 6);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6, 7)(), 7);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6, 7, 8)(), 8);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6, 7, 8, 9)(), 9);
+
+ int one = 1,
+ two = 2,
+ three = 3,
+ four = 4,
+ five = 5,
+ six = 6,
+ seven = 7,
+ eight = 8,
+ nine = 9;
+
+ // Nullary result_of fails
+ //BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference())(), 0);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one))(), 1);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two))(), 2);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three))(), 3);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four))(), 4);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five))(), 5);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six))(), 6);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven))(), 7);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight))(), 8);
+ BOOST_TEST_EQ(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight), var(nine))(), 9);
+
+ // Check using result_of with lambda functors
+ //BOOST_TEST_EQ(apply0(constant(0)), 0);
+ BOOST_TEST_EQ(apply1<int>(_1, one), 1);
+ BOOST_TEST_EQ(apply1<int&>(_1, one), 1);
+ BOOST_TEST_EQ(apply1<const int&>(_1, one), 1);
+ BOOST_TEST_EQ((apply2<int, int>(_1 + _2, one, two)), 3);
+ BOOST_TEST_EQ((apply2<int&, int&>(_1 + _2, one, two)), 3);
+ BOOST_TEST_EQ((apply2<const int&, const int&>(_1 + _2, one, two)), 3);
+ BOOST_TEST_EQ((apply3<int, int, int>(_1 + _2 + _3, one, two, three)), 6);
+ BOOST_TEST_EQ((apply3<int&, int&, int&>(_1 + _2 + _3, one, two, three)), 6);
+ BOOST_TEST_EQ((apply3<const int&, const int&, const int&>(_1 + _2 + _3, one, two, three)), 6);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/ret_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/ret_test.cpp
new file mode 100644
index 000000000..5830db67a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/ret_test.cpp
@@ -0,0 +1,54 @@
+// ret_test.cpp - The Boost Lambda Library -----------------------
+//
+// Copyright (C) 2009 Steven Watanabe
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+#include <boost/core/lightweight_test.hpp>
+
+#include <boost/lambda/lambda.hpp>
+
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+template<class R, class F>
+void test_ret(R r, F f) {
+ typename F::result_type x = f();
+ BOOST_MPL_ASSERT((boost::is_same<R, typename F::result_type>));
+ BOOST_TEST(x == r);
+}
+
+template<class R, class F, class T1>
+void test_ret(R r, F f, T1& t1) {
+ typename F::result_type x = f(t1);
+ BOOST_MPL_ASSERT((boost::is_same<R, typename F::result_type>));
+ BOOST_TEST(x == r);
+}
+
+class add_result {
+public:
+ add_result(int i = 0) : value(i) {}
+ friend bool operator==(const add_result& lhs, const add_result& rhs) {
+ return(lhs.value == rhs.value);
+ }
+private:
+ int value;
+};
+
+class addable {};
+add_result operator+(addable, addable) {
+ return add_result(7);
+}
+
+int main()
+{
+ addable test;
+ test_ret(add_result(7), boost::lambda::ret<add_result>(boost::lambda::_1 + test), test);
+ test_ret(8.0, boost::lambda::ret<double>(boost::lambda::constant(7) + 1));
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/rvalue_test.cpp b/src/boost/libs/phoenix/test/bll_compatibility/rvalue_test.cpp
new file mode 100644
index 000000000..37351855d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/rvalue_test.cpp
@@ -0,0 +1,57 @@
+// rvalue_test - test lambda function objects with rvalue arguments
+//
+// Copyright (c) 2007 Peter Dimov
+//
+// 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/lambda/lambda.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+{
+ using namespace boost::lambda;
+
+ int x = 0;
+ int const y = 1;
+ int const z = 2;
+
+ BOOST_TEST( _1( x ) == 0 );
+ BOOST_TEST( _1( y ) == 1 );
+ BOOST_TEST( _1( 2 ) == 2 );
+
+ BOOST_TEST( _2( x, x ) == 0 );
+ BOOST_TEST( _2( x, y ) == 1 );
+ BOOST_TEST( _2( x, 2 ) == 2 );
+
+ BOOST_TEST( _2( 4, x ) == 0 );
+ BOOST_TEST( _2( 4, y ) == 1 );
+ BOOST_TEST( _2( 4, 2 ) == 2 );
+
+ (_1 = _2)( x, y );
+ BOOST_TEST( x == y );
+
+ (_1 = _2)( x, 3 );
+ BOOST_TEST( x == 3 );
+
+ (_2 = _1)( z, x );
+ BOOST_TEST( x == z );
+
+ (_2 = _1)( 4, x );
+ BOOST_TEST( x == 4 );
+
+ BOOST_TEST( _3( x, x, x ) == x );
+ BOOST_TEST( _3( x, x, y ) == y );
+ BOOST_TEST( _3( x, x, 2 ) == 2 );
+
+ BOOST_TEST( _3( x, 5, x ) == x );
+ BOOST_TEST( _3( x, 5, y ) == y );
+ BOOST_TEST( _3( x, 5, 2 ) == 2 );
+
+ BOOST_TEST( _3( 9, 5, x ) == x );
+ BOOST_TEST( _3( 9, 5, y ) == y );
+ BOOST_TEST( _3( 9, 5, 2 ) == 2 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/bll_compatibility/switch_construct.cpp b/src/boost/libs/phoenix/test/bll_compatibility/switch_construct.cpp
new file mode 100644
index 000000000..86eedae6f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/bll_compatibility/switch_construct.cpp
@@ -0,0 +1,390 @@
+// switch_test.cpp -- The Boost Lambda Library --------------------------
+//
+// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -----------------------------------------------------------------------
+
+
+#include <boost/core/lightweight_test.hpp>
+
+
+#include "boost/lambda/lambda.hpp"
+#include "boost/lambda/if.hpp"
+#include "boost/lambda/switch.hpp"
+
+#include <iostream>
+#include <algorithm>
+#include <vector>
+#include <string>
+
+
+
+// Check that elements 0 -- index are 1, and the rest are 0
+bool check(const std::vector<int>& v, int index) {
+ using namespace boost::lambda;
+ int counter = 0;
+ std::vector<int>::const_iterator
+ result = std::find_if(v.begin(), v.end(),
+ ! if_then_else_return(
+ var(counter)++ <= index,
+ _1 == 1,
+ _1 == 0)
+ );
+ return result == v.end();
+}
+
+
+
+void do_switch_no_defaults_tests() {
+
+ using namespace boost::lambda;
+
+ int i = 0;
+ std::vector<int> v,w;
+
+ // elements from 0 to 9
+ std::generate_n(std::back_inserter(v),
+ 10,
+ var(i)++);
+ std::fill_n(std::back_inserter(w), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0]))
+ )
+ );
+
+ BOOST_TEST(check(w, 0));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1]))
+ )
+ );
+
+ BOOST_TEST(check(w, 1));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2]))
+ )
+ );
+
+ BOOST_TEST(check(w, 2));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3]))
+ )
+ );
+
+ BOOST_TEST(check(w, 3));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4]))
+ )
+ );
+
+ BOOST_TEST(check(w, 4));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5]))
+ )
+ );
+
+ BOOST_TEST(check(w, 5));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5])),
+ case_statement<6>(++var(w[6]))
+ )
+ );
+
+ BOOST_TEST(check(w, 6));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5])),
+ case_statement<6>(++var(w[6])),
+ case_statement<7>(++var(w[7]))
+ )
+ );
+
+ BOOST_TEST(check(w, 7));
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5])),
+ case_statement<6>(++var(w[6])),
+ case_statement<7>(++var(w[7])),
+ case_statement<8>(++var(w[8]))
+ )
+ );
+
+ BOOST_TEST(check(w, 8));
+ std::fill_n(w.begin(), 10, 0);
+
+}
+
+
+void do_switch_yes_defaults_tests() {
+
+ using namespace boost::lambda;
+
+ int i = 0;
+ std::vector<int> v,w;
+
+ // elements from 0 to 9
+ std::generate_n(std::back_inserter(v),
+ 10,
+ var(i)++);
+ std::fill_n(std::back_inserter(w), 10, 0);
+
+ int default_count;
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, -1));
+ BOOST_TEST_EQ(default_count, 10);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 0));
+ BOOST_TEST_EQ(default_count, 9);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 1));
+ BOOST_TEST_EQ(default_count, 8);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 2));
+ BOOST_TEST_EQ(default_count, 7);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 3));
+ BOOST_TEST_EQ(default_count, 6);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 4));
+ BOOST_TEST_EQ(default_count, 5);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 5));
+ BOOST_TEST_EQ(default_count, 4);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5])),
+ case_statement<6>(++var(w[6])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 6));
+ BOOST_TEST_EQ(default_count, 3);
+ std::fill_n(w.begin(), 10, 0);
+
+ // ---
+ default_count = 0;
+ std::for_each(v.begin(), v.end(),
+ switch_statement(
+ _1,
+ case_statement<0>(++var(w[0])),
+ case_statement<1>(++var(w[1])),
+ case_statement<2>(++var(w[2])),
+ case_statement<3>(++var(w[3])),
+ case_statement<4>(++var(w[4])),
+ case_statement<5>(++var(w[5])),
+ case_statement<6>(++var(w[6])),
+ case_statement<7>(++var(w[7])),
+ default_statement(++var(default_count))
+ )
+ );
+
+ BOOST_TEST(check(w, 7));
+ BOOST_TEST_EQ(default_count, 2);
+ std::fill_n(w.begin(), 10, 0);
+
+}
+
+void test_empty_cases() {
+
+ using namespace boost::lambda;
+
+ // ---
+ switch_statement(
+ _1,
+ default_statement()
+ )(make_const(1));
+
+ switch_statement(
+ _1,
+ case_statement<1>()
+ )(make_const(1));
+
+}
+
+int main()
+{
+ do_switch_no_defaults_tests();
+ do_switch_yes_defaults_tests();
+
+ test_empty_cases();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp
new file mode 100644
index 000000000..e0f5767d4
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_and_or_test.cpp
@@ -0,0 +1,77 @@
+/*==============================================================================
+ 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
+tester(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;
+
+ // &&
+
+ tester(bind(f, true) && bind(g, true), false, false, f(true) && g(true));
+ tester(bind(f, true) && bind(g, false), false, false, f(true) && g(false));
+
+ tester(bind(f, false) && bind(h), false, false, f(false) && h());
+
+ tester(bind(f, _1) && bind(g, _2), true, true, f(true) && g(true));
+ tester(bind(f, _1) && bind(g, _2), true, false, f(true) && g(false));
+
+ tester(bind(f, _1) && bind(h), false, false, f(false) && h());
+
+ // ||
+
+ tester(bind(f, false) || bind(g, true), false, false, f(false) || g(true));
+
+ tester(bind(f, false) || bind(g, false), false, false, f(false) || g(false));
+
+ tester(bind(f, true) || bind(h), false, false, f(true) || h());
+
+ tester(bind(f, _1) || bind(g, _2), false, true, f(false) || g(true));
+ tester(bind(f, _1) || bind(g, _2), false, false, f(false) || g(false));
+
+ tester(bind(f, _1) || bind(h), true, false, f(true) || h());
+
+ //
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp
new file mode 100644
index 000000000..79e7577da
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cdecl_mf_test.cpp
@@ -0,0 +1,146 @@
+/*==============================================================================
+ 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 __cdecl f0() { f1(17); return 0; }
+ int __cdecl g0() const { g1(17); return 0; }
+
+ int __cdecl f1(int a1) { hash = (hash * 17041 + a1) % 32768; return 0; }
+ int __cdecl g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
+
+ int __cdecl f2(int a1, int a2) { f1(a1); f1(a2); return 0; }
+ int __cdecl g2(int a1, int a2) const { g1(a1); g1(a2); return 0; }
+
+ int __cdecl f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); return 0; }
+ int __cdecl g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); return 0; }
+
+ int __cdecl f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); return 0; }
+ int __cdecl g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); return 0; }
+
+ int __cdecl f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); return 0; }
+ int __cdecl g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); return 0; }
+
+ int __cdecl f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
+ int __cdecl 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 __cdecl 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 __cdecl 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 __cdecl 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 __cdecl 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();
+}
+
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp
new file mode 100644
index 000000000..7c1daabc2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_const_test.cpp
@@ -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 tester(F const & f, A const & a)
+{
+ return f(a);
+}
+
+template<class F, class A> long testerv(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( tester( bind(f_0), i ) == 17041L );
+ BOOST_TEST( tester( bind(f_1, _1), i ) == 1L );
+ BOOST_TEST( tester( bind(f_2, _1, 2), i ) == 21L );
+ BOOST_TEST( tester( bind(f_3, _1, 2, 3), i ) == 321L );
+ BOOST_TEST( tester( bind(f_4, _1, 2, 3, 4), i ) == 4321L );
+ BOOST_TEST( tester( bind(f_5, _1, 2, 3, 4, 5), i ) == 54321L );
+ BOOST_TEST( tester( bind(f_6, _1, 2, 3, 4, 5, 6), i ) == 654321L );
+ BOOST_TEST( tester( bind(f_7, _1, 2, 3, 4, 5, 6, 7), i ) == 7654321L );
+ BOOST_TEST( tester( bind(f_8, _1, 2, 3, 4, 5, 6, 7, 8), i ) == 87654321L );
+ BOOST_TEST( tester( bind(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9), i ) == 987654321L );
+
+ BOOST_TEST( testerv( bind(fv_0), i ) == 17041L );
+ BOOST_TEST( testerv( bind(fv_1, _1), i ) == 1L );
+ BOOST_TEST( testerv( bind(fv_2, _1, 2), i ) == 21L );
+ BOOST_TEST( testerv( bind(fv_3, _1, 2, 3), i ) == 321L );
+ BOOST_TEST( testerv( bind(fv_4, _1, 2, 3, 4), i ) == 4321L );
+ BOOST_TEST( testerv( bind(fv_5, _1, 2, 3, 4, 5), i ) == 54321L );
+ BOOST_TEST( testerv( bind(fv_6, _1, 2, 3, 4, 5, 6), i ) == 654321L );
+ BOOST_TEST( testerv( bind(fv_7, _1, 2, 3, 4, 5, 6, 7), i ) == 7654321L );
+ BOOST_TEST( testerv( bind(fv_8, _1, 2, 3, 4, 5, 6, 7, 8), i ) == 87654321L );
+ BOOST_TEST( testerv( bind(fv_9, _1, 2, 3, 4, 5, 6, 7, 8, 9), i ) == 987654321L );
+}
+
+int main()
+{
+ function_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp
new file mode 100644
index 000000000..6a3326374
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_cv_test.cpp
@@ -0,0 +1,165 @@
+/*==============================================================================
+ 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;
+ using boost::phoenix::ref;
+ using boost::phoenix::cref;
+
+ 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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm1_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm1_test.cpp
new file mode 100644
index 000000000..68f50c070
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm1_test.cpp
@@ -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;
+ // Change bind_dm_test.cpp to bind to _1 twice.
+ BOOST_TEST( bind( &X::m, _1)( bind( f, _1 )( v ) ) == v );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp
new file mode 100644
index 000000000..43680def5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm2_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp
new file mode 100644
index 000000000..d50a4eaf8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp
@@ -0,0 +1,55 @@
+/*==============================================================================
+ 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 );
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1600) && (BOOST_MSVC < 1700)
+// bind is being confused with 'std::tr1::_Bind' to be found here
+// C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xxbind1(485)
+ int const & x = boost::phoenix::bind( &pair_type::first, _1 )( pair );
+#else
+ int const & x = bind( &pair_type::first, _1 )( pair );
+#endif
+
+ BOOST_TEST( &pair.first == &x );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp
new file mode 100644
index 000000000..5de4fc024
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_dm_test.cpp
@@ -0,0 +1,88 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+ Copyright (c) 2015 John Fletcher
+
+ 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;
+
+// NOTE: The second case does not work with compiler optimization.
+// This is a bug which has not yet been fixed.
+// The current test for gcc 4.7.3 does use -O2 but does not
+// satisfy this first part of the test for some unknown reason.
+// So this is set to run the first case for all gcc 4.7
+#if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \
+ defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 40700) && (BOOST_GCC_VERSION < 40800)
+ // Change bind_dm_test.cpp to bind to _1 twice.
+ BOOST_TEST( bind( &X::m, _1)( bind( f, _1 )( v ) ) == v );
+#else
+ BOOST_TEST( bind( &X::m, bind( f, _1 ) )( v ) == v );
+#endif
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp
new file mode 100644
index 000000000..b7203f49d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp
new file mode 100644
index 000000000..7340b63c1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq3_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp
new file mode 100644
index 000000000..ba33d531c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp
new file mode 100644
index 000000000..1c7a6baa9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_mf_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp
new file mode 100644
index 000000000..14033a5c7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fastcall_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp
new file mode 100644
index 000000000..8bb3cfe22
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fn2_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp
new file mode 100644
index 000000000..c03b3e931
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_fnobj2_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp
new file mode 100644
index 000000000..1e9c4425d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_function_test.cpp
@@ -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
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#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
+
+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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_interoperation_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_interoperation_test.cpp
new file mode 100644
index 000000000..fdce19a57
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_interoperation_test.cpp
@@ -0,0 +1,142 @@
+/*==============================================================================
+ Copyright (c) 2005 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+ Copyright (c) 2015 John Fletcher
+
+ 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/function.hpp>
+#include <boost/bind.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#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
+
+int f1( int x )
+{
+ return x;
+}
+
+int f2( int x, int y )
+{
+ return x + y;
+}
+
+struct X
+{
+ mutable int n;
+
+ X() : n(0) {}
+
+ int f0() { n += f1(17); return n; }
+ int g0() const { n += g1(17); return n; }
+
+
+ int f1(int a1) { return a1; }
+ int g1(int a1) const { return a1; }
+};
+
+struct Y
+{
+ int m;
+};
+
+namespace phx = boost::phoenix;
+using phx::placeholders::arg1;
+using phx::placeholders::arg2;
+using boost::phoenix::ref;
+
+void member_test()
+{
+ Y y = { 17041 };
+ Y * py = &y;
+
+ BOOST_TEST( boost::bind( &Y::m, _1 )( y ) == 17041 );
+ BOOST_TEST( boost::bind( &Y::m, _1 )( py ) == 17041 );
+
+ BOOST_TEST( phx::bind( &Y::m, _1 )( y ) == 17041 );
+ BOOST_TEST( phx::bind( &Y::m, _1 )( py ) == 17041 );
+
+ BOOST_TEST( phx::bind( &Y::m, arg1 )( y ) == 17041 );
+ BOOST_TEST( phx::bind( &Y::m, arg1 )( py ) == 17041 );
+
+ BOOST_TEST( boost::bind( &Y::m, y )() == 17041 );
+ BOOST_TEST( boost::bind( &Y::m, py )() == 17041 );
+ //BOOST_TEST( boost::bind( &Y::m, ref(y) )() == 17041 );
+
+ BOOST_TEST( phx::bind( &Y::m, y )() == 17041 );
+ BOOST_TEST( phx::bind( &Y::m, py )() == 17041 );
+ BOOST_TEST( phx::bind( &Y::m, ref(y) )() == 17041 );
+
+ return;
+}
+
+void member_function_test()
+{
+
+ X x;
+
+ // 0
+
+ BOOST_TEST(boost::bind(&X::f0, &x )() == 17);
+ //boost::bind(&X::f0, ref(x) )(); boost::bind does not work with phx::ref.
+
+ BOOST_TEST(boost::bind(&X::g0, &x )() == 34);
+ BOOST_TEST(boost::bind(&X::g0, x )() == 51);
+ //boost::bind(&X::g0, ref(x) )();
+
+ BOOST_TEST(phx::bind(&X::f0, &x )() == 51);
+ BOOST_TEST(phx::bind(&X::f0, ref(x) )() == 68);
+
+ BOOST_TEST(phx::bind(&X::g0, &x )() == 85);
+ BOOST_TEST(phx::bind(&X::g0, x )() == 102);
+ BOOST_TEST(phx::bind(&X::g0, ref(x) )() == 102);
+
+ return;
+}
+
+int main()
+{
+
+ boost::function<int (int)> fun1_f1(boost::bind ( &f1, _1) );
+ boost::function<int (int)> fun2_f1( phx::bind ( &f1, _1) );
+ boost::function<int (int)> fun3_f1( phx::bind ( &f1, arg1) );
+
+ BOOST_TEST( fun1_f1(1) == 1 );
+ BOOST_TEST( fun2_f1(2) == 2 );
+ BOOST_TEST( fun3_f1(3) == 3 );
+
+ boost::function<int (int, int)> fun1_f2(boost::bind ( &f2, _1, _2) );
+ boost::function<int (int, int)> fun2_f2( phx::bind ( &f2, _1, _2) );
+ boost::function<int (int, int)> fun3_f2( phx::bind ( &f2, arg1, arg2) );
+
+ BOOST_TEST( fun1_f2(1,2) == 3 );
+ BOOST_TEST( fun2_f2(2,3) == 5 );
+ BOOST_TEST( fun3_f2(3,4) == 7 );
+
+ member_function_test();
+ member_test();
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp
new file mode 100644
index 000000000..a0e23de58
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_lookup_problem_test.cpp
@@ -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;
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp
new file mode 100644
index 000000000..178bd6e1c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_mf2_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp
new file mode 100644
index 000000000..e49980692
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_not_test.cpp
@@ -0,0 +1,61 @@
+/*==============================================================================
+ 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>
+
+template<class F, class A1, class R> void tester( 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;
+
+ tester( !bind( f, true ), 0, !f( true ) );
+ tester( !bind( g, _1 ), 5, !g( 5 ) );
+ tester( bind( f, !bind( f, true ) ), 0, f( !f( true ) ) );
+ tester( bind( f, !bind( f, _1 ) ), true, f( !f( true ) ) );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp
new file mode 100644
index 000000000..817805b6b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp
@@ -0,0 +1,87 @@
+/*==============================================================================
+ 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 + 1};
+};
+
+} // namespace boost
+
+int main()
+{
+ using boost::phoenix::bind;
+
+ 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;
+
+ custom_placeholder<0> p1;
+ custom_placeholder<1> p2;
+ custom_placeholder<2> p3;
+ custom_placeholder<3> p4;
+ custom_placeholder<4> p5;
+ custom_placeholder<5> p6;
+ custom_placeholder<6> p7;
+ custom_placeholder<7> p8;
+ custom_placeholder<8> 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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp
new file mode 100644
index 000000000..486028be2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_ref_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp
new file mode 100644
index 000000000..63d3c66aa
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rel_test.cpp
@@ -0,0 +1,102 @@
+/*==============================================================================
+ 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
+
+ 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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp1_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp1_test.cpp
new file mode 100644
index 000000000..a276014c6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp1_test.cpp
@@ -0,0 +1,68 @@
+/*==============================================================================
+ 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;
+ using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Change bind_rv_sp_test.cpp to bind to _1.
+ BOOST_TEST( bind( &X::f, _1) ( bind( &Y::f, &y )()) == 42 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp2_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp2_test.cpp
new file mode 100644
index 000000000..ca505f25a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp2_test.cpp
@@ -0,0 +1,68 @@
+/*==============================================================================
+ 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;
+ //using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Simplify Change bind_rv_sp_test.cpp to bind to _1.
+ BOOST_TEST( (*bind( &Y::f, &y )()).f() == 42 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp3_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp3_test.cpp
new file mode 100644
index 000000000..2aff70a66
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp3_test.cpp
@@ -0,0 +1,68 @@
+/*==============================================================================
+ 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> g()
+ {
+ return boost::shared_ptr<X>( new X( 42 ) );
+ }
+};
+
+int main()
+{
+ using boost::phoenix::bind;
+ using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Change bind_rv_sp_test.cpp to bind to _1. Renamed f to g in y
+ BOOST_TEST( bind( &X::f, _1) ( bind( &Y::g, &y )()) == 42 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp4_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp4_test.cpp
new file mode 100644
index 000000000..1cd9a8876
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp4_test.cpp
@@ -0,0 +1,70 @@
+/*==============================================================================
+ 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;
+ //using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Change bind_rv_sp_test.cpp to bind to _1. Renamed f to g in y
+ //BOOST_TEST( bind( &X::f, _1) ( bind( &Y::g, &y )()) == 42 );
+ boost::shared_ptr<X> xp = bind( &Y::f, &y )();
+ BOOST_TEST( bind( &X::f, xp)() == 42 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp5_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp5_test.cpp
new file mode 100644
index 000000000..4d82a46d1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp5_test.cpp
@@ -0,0 +1,70 @@
+/*==============================================================================
+ 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;
+ //using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Change bind_rv_sp_test.cpp to bind to _1. Renamed f to g in y
+ //BOOST_TEST( bind( &X::f, _1) ( bind( &Y::g, &y )()) == 42 );
+ boost::shared_ptr<X> xp = bind( &Y::f, &y )();
+ //BOOST_TEST( bind( &X::f, xp)() == 42 );
+ BOOST_TEST( (*xp).f() == 42 );
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp6_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp6_test.cpp
new file mode 100644
index 000000000..446d17e75
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp6_test.cpp
@@ -0,0 +1,71 @@
+/*==============================================================================
+ 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;
+ //using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Change bind_rv_sp_test.cpp to bind to _1. Renamed f to g in y
+ //BOOST_TEST( bind( &X::f, _1) ( bind( &Y::g, &y )()) == 42 );
+ //boost::shared_ptr<X> xp = bind( &Y::f, &y )();
+ boost::shared_ptr<X> xp = y.f();
+ BOOST_TEST( bind( &X::f, xp)() == 42 );
+ //BOOST_TEST( (*xp).f() == 42 );
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp7_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp7_test.cpp
new file mode 100644
index 000000000..7b050bf70
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp7_test.cpp
@@ -0,0 +1,71 @@
+/*==============================================================================
+ 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;
+ //using boost::phoenix::placeholders::_1;
+
+ Y y;
+
+ // Change bind_rv_sp_test.cpp to bind to _1. Renamed f to g in y
+ //BOOST_TEST( bind( &X::f, _1) ( bind( &Y::g, &y )()) == 42 );
+ //boost::shared_ptr<X> xp = bind( &Y::f, &y )();
+ boost::shared_ptr<X> xp = y.f();
+ // BOOST_TEST( bind( &X::f, xp)() == 42 );
+ BOOST_TEST( (*xp).f() == 42 );
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp
new file mode 100644
index 000000000..3fe67c48f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp_test.cpp
@@ -0,0 +1,75 @@
+/*==============================================================================
+ Copyright (c) 2006 Peter Dimov
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+ Copyright (c) 2015 John Fletcher
+
+ 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;
+
+ // MSVC 10,9 and 8 all give a COMDAT error with the full test.
+ // This also fails:
+ //boost::shared_ptr<X> xp = bind( &Y::f, &y )();
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1700)
+ boost::shared_ptr<X> xp = y.f();
+ BOOST_TEST( bind( &X::f, xp)() == 42 );
+#else
+ BOOST_TEST( bind( &X::f, bind( &Y::f, &y ) )() == 42 );
+#endif
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp
new file mode 100644
index 000000000..049e45e18
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rvalue_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp
new file mode 100644
index 000000000..fae0e9c60
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stateful_test.cpp
@@ -0,0 +1,301 @@
+/*==============================================================================
+ 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;
+ }
+};
+
+class Y
+{
+private:
+
+ int state_;
+
+public:
+
+ Y(): state_(0)
+ {
+ }
+
+ int state() const
+ {
+ return state_;
+ }
+
+ typedef int result_type;
+
+ int operator()()
+ {
+ return state_ += 17041;
+ }
+
+ int operator()(int x1)
+ {
+ return state_ += x1;
+ }
+
+ int operator()(int x1, int x2)
+ {
+ return state_ += x1+x2;
+ }
+
+ int operator()(int x1, int x2, int x3)
+ {
+ return state_ += x1+x2+x3;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4)
+ {
+ return state_ += x1+x2+x3+x4;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5)
+ {
+ return state_ += x1+x2+x3+x4+x5;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6)
+ {
+ return state_ += x1+x2+x3+x4+x5+x6;
+ }
+
+ int operator()(int x1, int x2, int x3, int x4, int x5, int x6, int x7)
+ {
+ 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)
+ {
+ 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)
+ {
+ 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 <typename> struct wrap {};
+
+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 );
+
+ Y y;
+
+ int n = y.state();
+
+ ::test( bind( ref(y) ), n, 17041 );
+ n += 3 * 17041;
+
+ ::test( bind( ref(y), 1 ), n, 1 );
+ n += 3*1;
+
+ ::test( bind( ref(y), 1, 2 ), n, 1+2 );
+ n += 3*(1+2);
+
+ ::test( bind( ref(y), 1, 2, 3 ), n, 1+2+3 );
+ n += 3*(1+2+3);
+
+ ::test( bind( ref(y), 1, 2, 3, 4 ), n, 1+2+3+4 );
+ n += 3*(1+2+3+4);
+
+ ::test( bind( ref(y), 1, 2, 3, 4, 5 ), n, 1+2+3+4+5 );
+ n += 3*(1+2+3+4+5);
+
+ ::test( bind( ref(y), 1, 2, 3, 4, 5, 6 ), n, 1+2+3+4+5+6 );
+ n += 3*(1+2+3+4+5+6);
+
+ ::test( bind( ref(y), 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(y), 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(y), 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( y.state() == n );
+}
+
+void stateful_function_test()
+{
+ using boost::phoenix::ref;
+
+ ::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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp
new file mode 100644
index 000000000..b7ecdd183
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_mf_test.cpp
@@ -0,0 +1,167 @@
+/*==============================================================================
+ 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
+
+ std::cout << typeid(typename boost::result_of<X::f0()>::type).name() << "\n";
+
+ 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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp
new file mode 100644
index 000000000..b3723a5da
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_stdcall_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp
new file mode 100644
index 000000000..1225b8abf
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_test.cpp
@@ -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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp
new file mode 100644
index 000000000..9a02a271f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_unary_addr.cpp
@@ -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;
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_dm_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_dm_test.cpp
new file mode 100644
index 000000000..5755fb655
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_dm_test.cpp
@@ -0,0 +1,73 @@
+/*==============================================================================
+ Copyright (c) 2006 Peter Dimov
+ Copyright (c) 2014 Agustin Berge
+ Copyright (c) 2015 John Fletcher
+
+ 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/ref.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 Z
+{
+ int m;
+};
+
+void member_data_test()
+{
+ using boost::phoenix::bind;
+
+ Z z = { 17041 };
+ Z * pz = &z;
+
+ bind<void>( &Z::m, _1 )( z );
+ bind<void>( &Z::m, _1 )( pz );
+
+ bind<void>( &Z::m, z )();
+ bind<void>( &Z::m, pz )();
+ bind<void>( &Z::m, boost::ref(z) )();
+
+
+ Z const cz = z;
+ Z const * pcz = &cz;
+
+ bind<void>( &Z::m, _1 )( cz );
+ bind<void>( &Z::m, _1 )( pcz );
+
+ bind<void>( &Z::m, cz )();
+ bind<void>( &Z::m, pcz )();
+ bind<void>( &Z::m, boost::ref(cz) )();
+}
+
+int main()
+{
+ member_data_test();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_mf_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_mf_test.cpp
new file mode 100644
index 000000000..62c2dcda7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_mf_test.cpp
@@ -0,0 +1,171 @@
+#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
+
+//
+// bind_void_mf_test.cpp - test for bind<void> with member functions
+//
+// Copyright (c) 2008 Peter Dimov
+// Copyright (c) 2014 Agustin Berge
+//
+// 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/bind.hpp>
+#include <boost/ref.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;
+
+//
+
+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 namespace boost;
+
+ X x;
+
+ // 0
+
+ bind<void>(&X::f0, &x)();
+ bind<void>(&X::f0, ref(x))();
+
+ bind<void>(&X::g0, &x)();
+ bind<void>(&X::g0, x)();
+ bind<void>(&X::g0, ref(x))();
+
+ // 1
+
+ bind<void>(&X::f1, &x, 1)();
+ bind<void>(&X::f1, ref(x), 1)();
+
+ bind<void>(&X::g1, &x, 1)();
+ bind<void>(&X::g1, x, 1)();
+ bind<void>(&X::g1, ref(x), 1)();
+
+ // 2
+
+ bind<void>(&X::f2, &x, 1, 2)();
+ bind<void>(&X::f2, ref(x), 1, 2)();
+
+ bind<void>(&X::g2, &x, 1, 2)();
+ bind<void>(&X::g2, x, 1, 2)();
+ bind<void>(&X::g2, ref(x), 1, 2)();
+
+ // 3
+
+ bind<void>(&X::f3, &x, 1, 2, 3)();
+ bind<void>(&X::f3, ref(x), 1, 2, 3)();
+
+ bind<void>(&X::g3, &x, 1, 2, 3)();
+ bind<void>(&X::g3, x, 1, 2, 3)();
+ bind<void>(&X::g3, ref(x), 1, 2, 3)();
+
+ // 4
+
+ bind<void>(&X::f4, &x, 1, 2, 3, 4)();
+ bind<void>(&X::f4, ref(x), 1, 2, 3, 4)();
+
+ bind<void>(&X::g4, &x, 1, 2, 3, 4)();
+ bind<void>(&X::g4, x, 1, 2, 3, 4)();
+ bind<void>(&X::g4, ref(x), 1, 2, 3, 4)();
+
+ // 5
+
+ bind<void>(&X::f5, &x, 1, 2, 3, 4, 5)();
+ bind<void>(&X::f5, ref(x), 1, 2, 3, 4, 5)();
+
+ bind<void>(&X::g5, &x, 1, 2, 3, 4, 5)();
+ bind<void>(&X::g5, x, 1, 2, 3, 4, 5)();
+ bind<void>(&X::g5, ref(x), 1, 2, 3, 4, 5)();
+
+ // 6
+
+ bind<void>(&X::f6, &x, 1, 2, 3, 4, 5, 6)();
+ bind<void>(&X::f6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ bind<void>(&X::g6, &x, 1, 2, 3, 4, 5, 6)();
+ bind<void>(&X::g6, x, 1, 2, 3, 4, 5, 6)();
+ bind<void>(&X::g6, ref(x), 1, 2, 3, 4, 5, 6)();
+
+ // 7
+
+ bind<void>(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind<void>(&X::f7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ bind<void>(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
+ bind<void>(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
+ bind<void>(&X::g7, ref(x), 1, 2, 3, 4, 5, 6, 7)();
+
+ // 8
+
+ bind<void>(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind<void>(&X::f8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
+
+ bind<void>(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind<void>(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
+ bind<void>(&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();
+}
diff --git a/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_test.cpp b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_test.cpp
new file mode 100644
index 000000000..bb1e80dae
--- /dev/null
+++ b/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_void_test.cpp
@@ -0,0 +1,139 @@
+#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
+
+//
+// bind_void_test.cpp - test for bind<void>
+//
+// Copyright (c) 2008 Peter Dimov
+// Copyright (c) 2014 Agustin Berge
+//
+// 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/bind.hpp>
+#include <boost/ref.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 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 function_test()
+{
+ using namespace boost;
+
+ int const i = 1;
+
+ BOOST_TEST( (bind<void>(f_0)(i), (global_result == 17041L)) );
+ BOOST_TEST( (bind<void>(f_1, _1)(i), (global_result == 1L)) );
+ BOOST_TEST( (bind<void>(f_2, _1, 2)(i), (global_result == 21L)) );
+ BOOST_TEST( (bind<void>(f_3, _1, 2, 3)(i), (global_result == 321L)) );
+ BOOST_TEST( (bind<void>(f_4, _1, 2, 3, 4)(i), (global_result == 4321L)) );
+ BOOST_TEST( (bind<void>(f_5, _1, 2, 3, 4, 5)(i), (global_result == 54321L)) );
+ BOOST_TEST( (bind<void>(f_6, _1, 2, 3, 4, 5, 6)(i), (global_result == 654321L)) );
+ BOOST_TEST( (bind<void>(f_7, _1, 2, 3, 4, 5, 6, 7)(i), (global_result == 7654321L)) );
+ BOOST_TEST( (bind<void>(f_8, _1, 2, 3, 4, 5, 6, 7, 8)(i), (global_result == 87654321L)) );
+ BOOST_TEST( (bind<void>(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i), (global_result == 987654321L)) );
+}
+
+//
+
+struct Y
+{
+ short operator()(short & r) const { return global_result = ++r; }
+ int operator()(int a, int b) const { return global_result = a + 10 * b; }
+ long operator() (long a, long b, long c) const { return global_result = 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 namespace boost;
+
+ short i(6);
+
+ int const k = 3;
+
+ BOOST_TEST( (bind<void>(Y(), ref(i))(), (global_result == 7)) );
+ BOOST_TEST( (bind<void>(Y(), ref(i))(), (global_result == 8)) );
+ BOOST_TEST( (bind<void>(Y(), i, _1)(k), (global_result == 38)) );
+ BOOST_TEST( (bind<void>(Y(), i, _1, 9)(k), (global_result == 938)) );
+ BOOST_TEST( (bind<void>(Y(), i, _1, 9, 4)(k), (global_result == 4938)) );
+}
+
+int main()
+{
+ function_test();
+ function_object_test();
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/container/container_tests.hpp b/src/boost/libs/phoenix/test/container/container_tests.hpp
new file mode 100644
index 000000000..6dc6668e0
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests.hpp
@@ -0,0 +1,947 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(CONTAINER_TESTS_HPP)
+#define CONTAINER_TESTS_HPP
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/stl/container/container.hpp>
+
+#include <iostream>
+#include <typeinfo>
+#include <deque>
+#include <list>
+#include <map>
+#include <set>
+#include <vector>
+#include <utility>
+#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
+#include <unordered_map>
+#endif
+#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
+#include <unordered_set>
+#endif
+
+#ifdef BOOST_MSVC
+#pragma warning(disable : 4800)
+#endif
+
+using std::cerr;
+namespace phx = boost::phoenix;
+
+template <typename T> inline T const build_assoc();
+
+std::deque<int> const build_deque();
+std::list<int> const build_list();
+std::map<int, int> const build_map();
+std::multimap<int, int> const build_multimap();
+std::vector<int> const build_vector();
+std::set<int> const build_set();
+std::multiset<int> const build_multiset();
+template <> inline std::map<int, int> const build_assoc() { return build_map(); }
+template <> inline std::multimap<int, int> const build_assoc() { return build_multimap(); }
+template <> inline std::set<int> const build_assoc() { return build_set(); }
+template <> inline std::multiset<int> const build_assoc() { return build_multiset(); }
+#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
+std::unordered_map<int, int> const build_unordered_map();
+std::unordered_multimap<int, int> const build_unordered_multimap();
+template <> inline std::unordered_map<int, int> const build_assoc() { return build_unordered_map(); }
+template <> inline std::unordered_multimap<int, int> const build_assoc() { return build_unordered_multimap(); }
+#endif
+#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
+std::unordered_set<int> const build_unordered_set();
+std::unordered_multiset<int> const build_unordered_multiset();
+template <> inline std::unordered_set<int> const build_assoc() { return build_unordered_set(); }
+template <> inline std::unordered_multiset<int> const build_assoc() { return build_unordered_multiset(); }
+#endif
+
+inline bool
+test(bool fail)
+{
+ BOOST_TEST(!fail);
+ return fail;
+}
+
+template <typename Container>
+void test_assign(Container c)
+{
+ using phx::arg_names::arg1;
+
+ typename Container::size_type count = 2;
+ typename Container::const_iterator first = c.begin();
+ typename Container::const_iterator second = first;
+ typename Container::value_type value = *first;
+
+ phx::assign(arg1, count, value)(c);
+
+ // iterators may be invalidated!
+ first = c.begin();
+ second = first;
+
+ std::advance(second, 1);
+ if (test(*first != *second)) {
+ cerr << "Failed " << typeid(Container).name() << " test_assign 1\n";
+ return;
+ }
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ Container const const_c = c;
+ phx::assign(const_c, count, value);
+#endif
+}
+
+template <typename Container>
+void test_assign2(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+
+ Container c2 = c;
+ typename Container::const_iterator first = c2.begin();
+ typename Container::const_iterator last = c2.end();
+ typename Container::size_type size = c2.size();
+
+ c.clear();
+ phx::assign(arg1, arg2, arg3)(c, first, last);
+ if (test(c.size() != size)) {
+ cerr << "Failed " << typeid(Container).name()
+ << " test_assign2 1\n"
+ << "size == " << c.size() << '\n';
+ return;
+ }
+
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ Container const const_c = c;
+ phx::assign(const_c, first, second);
+#endif
+}
+
+template <typename Container>
+void test_at(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::at;
+
+ typename Container::reference r1 = at(arg1, 0)(c);
+ if (test(r1 != c.at(0))) {
+ cerr << "Failed " << typeid(Container).name() << " test_at 1\n";
+ return;
+ }
+
+ typename Container::const_reference r2 = at(arg1, 0)(c);
+ if (test(r2 != c.at(0))) {
+ cerr << "Failed " << typeid(Container).name() << " test_at 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::reference r3 = at(arg1, 0)(const_c);
+#endif
+
+ typename Container::const_reference r4 = at(arg1, 0)(const_c);
+ if (test(r4 != c.at(0))) {
+ cerr << "Failed " << typeid(Container).name() << " test_at 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_back(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::back;
+
+ typename Container::reference r1 = back(arg1)(c);
+ if (test(r1 != c.back())) {
+ cerr << "Failed " << typeid(Container).name() << " test_back 1\n";
+ return;
+ }
+ typename Container::const_reference r2 = back(arg1)(c);
+ if (test(r2 != c.back())) {
+ cerr << "Failed " << typeid(Container).name() << " test_back 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::reference r3 = back(arg1)(const_c);
+#endif
+
+ typename Container::const_reference r4 = back(arg1)(const_c);
+ if (test(r4 != c.back())) {
+ cerr << "Failed " << typeid(Container).name() << " test_back 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_begin(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::begin;
+
+ typename Container::iterator it1 = begin(arg1)(c);
+ if (test(it1 != c.begin())) {
+ cerr << "Failed " << typeid(Container).name() << " test_begin 1\n";
+ return;
+ }
+ typename Container::const_iterator it2 = begin(arg1)(c);
+ if (test(it2 != c.begin())) {
+ cerr << "Failed " << typeid(Container).name() << " test_begin 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::iterator it3 = begin(arg1)(const_c);
+#endif
+
+ typename Container::const_iterator it4 = begin(arg1)(const_c);
+ if (test(it4 != const_c.begin())) {
+ cerr << "Failed " << typeid(Container).name() << " test_begin 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_capacity(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::capacity;
+
+ typename Container::size_type s1 = capacity(arg1)(c);
+ if (test(s1 != c.capacity())) {
+ cerr << "Failed " << typeid(Container).name() << " test_capacity 1\n";
+ return;
+ }
+
+ Container const const_c = c;
+ typename Container::size_type s2 = capacity(arg1)(const_c);
+ if (test(s2 != const_c.capacity())) {
+ cerr << "Failed " << typeid(Container).name() << " test_capacity 2\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_clear(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::clear;
+
+ clear(arg1)(c);
+ if (test(!c.empty())) {
+ cerr << "Failed " << typeid(Container).name() << " test_clear 1\n";
+ return;
+ }
+
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ Container const const_c = c;
+ clear(arg1)(const_c);
+#endif
+}
+
+template <typename Container>
+void test_empty(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::empty;
+
+ typename Container::size_type s1 = empty(arg1)(c);
+ if (test(bool(s1) != c.empty())) {
+ cerr << "Failed " << typeid(Container).name() << " test_empty 1\n";
+ return;
+ }
+
+ Container const const_c = c;
+ typename Container::size_type s2 = empty(arg1)(const_c);
+ if (test(bool(s2) != const_c.empty())) {
+ cerr << "Failed " << typeid(Container).name() << " test_empty 2\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_end(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::end;
+
+ typename Container::iterator it1 = end(arg1)(c);
+ if (test(it1 != c.end())) {
+ cerr << "Failed " << typeid(Container).name() << " test_end 1\n";
+ return;
+ }
+ typename Container::const_iterator it2 = end(arg1)(c);
+ if (test(it2 != c.end())) {
+ cerr << "Failed " << typeid(Container).name() << " test_end 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::iterator it3 = end(arg1)(const_c);
+#endif
+
+ typename Container::const_iterator it4 = end(arg1)(const_c);
+ if (test(it4 != const_c.end())) {
+ cerr << "Failed " << typeid(Container).name() << " test_end 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_erase(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+ using phx::erase;
+
+ Container const const_c = c;
+
+ typename Container::size_type size = c.size();
+ typename Container::iterator c_begin = c.begin();
+ erase(arg1, arg2)(c, c_begin);
+ if (test(c.size() + 1 != size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_erase 1\n";
+ return;
+ }
+
+ c_begin = c.begin();
+ typename Container::iterator c_end = c.end();
+ erase(arg1, arg2, arg3)(c, c_begin, c_end);
+ if (test(!c.empty())) {
+ cerr << "Failed " << typeid(Container).name() << " test_erase 2\n";
+ return;
+ }
+
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ erase(arg1, const_c.begin())(const_c);
+ erase(arg1, const_c.begin(), const_c.end())(const_c);
+#endif
+}
+
+template <typename Container>
+void test_map_erase(Container c)
+{
+ test_erase(c);
+ if (boost::report_errors() != 0)
+ return;
+
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::erase;
+
+ typename Container::value_type const value = *c.begin();
+ typename Container::key_type const key = value.first;
+ typename Container::size_type const removed =
+ erase(arg1, arg2)(c, key);
+ if (test(removed != 1)) {
+ cerr << "Failed " << typeid(Container).name() << " test_map_erase 1\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_set_erase(Container c)
+{
+ test_erase(c);
+ if (boost::report_errors() != 0)
+ return;
+
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::erase;
+
+ typename Container::value_type const value = *c.begin();
+ typename Container::key_type const key = value;
+ typename Container::size_type const removed =
+ erase(arg1, arg2)(c, key);
+ if (test(removed != 1)) {
+ cerr << "Failed " << typeid(Container).name() << " test_set_erase 1\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_front(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::front;
+
+ typename Container::reference r1 = front(arg1)(c);
+ if (test(r1 != c.front())) {
+ cerr << "Failed " << typeid(Container).name() << " test_front 1\n";
+ return;
+ }
+ typename Container::const_reference r2 = front(arg1)(c);
+ if (test(r2 != c.front())) {
+ cerr << "Failed " << typeid(Container).name() << " test_front 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::reference r3 = front(arg1)(const_c);
+#endif
+
+ typename Container::const_reference r4 = front(arg1)(const_c);
+ if (test(r4 != c.front())) {
+ cerr << "Failed " << typeid(Container).name() << " test_front 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_get_allocator(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::get_allocator;
+
+ Container const const_c = c;
+
+ typename Container::allocator_type a1 = get_allocator(arg1)(c);
+ if (test(a1 != c.get_allocator())) {
+ cerr << "Failed " << typeid(Container).name() << " test_get_allocator 1\n";
+ return;
+ }
+
+ typename Container::allocator_type a2 = get_allocator(arg1)(const_c);
+ if (test(a2 != const_c.get_allocator())) {
+ cerr << "Failed " << typeid(Container).name() << " test_get_allocator 2\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_insert(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::insert;
+
+ typename Container::value_type const value = *c.begin();
+ typename Container::iterator it = insert(arg1, c.begin(), value)(c);
+ if (test(it != c.begin() || *it != *(++it))) {
+ cerr << "Failed " << typeid(Container).name() << " test_insert 1\n";
+ return;
+ }
+
+ typename Container::size_type size = c.size();
+ insert(arg1, c.begin(), 3, value)(c);
+ if (test(c.size() != size + 3)) {
+ cerr << "Failed " << typeid(Container).name() << " test_insert 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+ size = c.size();
+ insert(arg1, c.begin(), const_c.begin(), const_c.end())(c);
+ if (test(c.size() != 2 * size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_insert 3\n";
+ return;
+ }
+}
+
+template <typename Map>
+inline void test_map_insert(Map c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+
+ typename Map::value_type const value = *c.begin();
+ typename Map::iterator c_begin = c.begin();
+ // wrapper for
+ // iterator insert(iterator where, const value_type& val);
+ typename Map::iterator it =
+ phx::insert(arg1, arg2, arg3)(c, c_begin, value);
+
+ if (test(it != c.begin() /*|| *it != *(++it)*/)) {
+ cerr << "Failed " << typeid(Map).name() << " test_map_insert 1\n";
+ return;
+ }
+
+ // wrapper for
+ // pair<iterator, bool> insert(const value_type& val);
+ typename Map::value_type const value2(1400, 2200);
+ std::pair<typename Map::iterator, bool> result =
+ phx::insert(arg1, arg2)(c, value2);
+ if (test(!result.second)) {
+ cerr << "Failed " << typeid(Map).name() << " test_map_insert 2\n";
+ return;
+ }
+
+ // wrapper for
+ // template<class InIt>
+ // void insert(InIt first, InIt last);
+ Map const const_c = build_assoc<Map>();
+ typename Map::size_type size = c.size();
+ phx::insert(arg1, const_c.begin(), const_c.end())(c);
+ if (test(c.size() != size + const_c.size())) {
+ cerr << "Failed " << typeid(Map).name() << " test_map_insert 3\n";
+ return;
+ }
+}
+
+template <typename Multimap>
+inline void test_multimap_insert(Multimap c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+
+ typename Multimap::value_type const value = *c.begin();
+ typename Multimap::iterator c_begin = c.begin();
+ std::size_t old_size = c.size();
+ // wrapper for
+ // iterator insert(iterator where, const value_type& val);
+ typename Multimap::iterator it =
+ phx::insert(arg1, arg2, arg3)(c, c_begin, value);
+
+ if (test(*it != value || c.size() != old_size + 1)) {
+ cerr << "Failed " << typeid(Multimap).name()
+ << " test_multimap_insert 1\n";
+ return;
+ }
+
+ // wrapper for
+ // iterator insert(const value_type& val);
+ typename Multimap::value_type const value2(1400, 2200);
+ it = phx::insert(arg1, arg2)(c, value2);
+ if (test(it == c.end())) {
+ cerr << "Failed " << typeid(Multimap).name()
+ << " test_multimap_insert 2\n";
+ return;
+ }
+
+ // wrapper for
+ // template<class InIt>
+ // void insert(InIt first, InIt last);
+ Multimap const const_c = build_assoc<Multimap>();
+ typename Multimap::size_type size = c.size();
+ phx::insert(arg1, const_c.begin(), const_c.end())(c);
+ if (test(c.size() != size + const_c.size())) {
+ cerr << "Failed " << typeid(Multimap).name()
+ << " test_multimap_insert 3\n";
+ return;
+ }
+}
+
+template <typename Set>
+inline void test_set_insert(Set c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+
+ typename Set::value_type const value = *c.begin();
+ typename Set::iterator c_begin = c.begin();
+ // wrapper for
+ // iterator insert(iterator where, const value_type& val);
+ typename Set::iterator it =
+ phx::insert(arg1, arg2, arg3)(c, c_begin, value);
+
+ if (test(it != c.begin() /*|| *it != *(++it)*/)) {
+ cerr << "Failed " << typeid(Set).name() << " test_set_insert 1\n";
+ return;
+ }
+
+ // wrapper for
+ // pair<iterator, bool> insert(const value_type& val);
+ typename Set::value_type const value2(1400);
+ std::pair<typename Set::iterator, bool> result =
+ phx::insert(arg1, arg2)(c, value2);
+ if (test(!result.second)) {
+ cerr << "Failed " << typeid(Set).name() << " test_set_insert 2\n";
+ return;
+ }
+
+ // wrapper for
+ // template<class InIt>
+ // void insert(InIt first, InIt last);
+ Set const const_c = build_assoc<Set>();
+ typename Set::size_type size = c.size();
+ phx::insert(arg1, const_c.begin(), const_c.end())(c);
+ if (test(c.size() != size + const_c.size())) {
+ cerr << "Failed " << typeid(Set).name() << " test_set_insert 3\n";
+ return;
+ }
+}
+
+template <typename Multiset>
+inline void test_multiset_insert(Multiset c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+
+ typename Multiset::value_type const value = *c.begin();
+ typename Multiset::iterator c_begin = c.begin();
+ std::size_t old_size = c.size();
+ // wrapper for
+ // iterator insert(iterator where, const value_type& val);
+ typename Multiset::iterator it =
+ phx::insert(arg1, arg2, arg3)(c, c_begin, value);
+
+ if (test(*it != value || c.size() != old_size + 1)) {
+ cerr << "Failed " << typeid(Multiset).name()
+ << " test_multiset_insert 1\n";
+ return;
+ }
+
+ // wrapper for
+ // iterator insert(const value_type& val);
+ typename Multiset::value_type const value2(1400);
+ it = phx::insert(arg1, arg2)(c, value2);
+ if (test(it == c.end())) {
+ cerr << "Failed " << typeid(Multiset).name()
+ << " test_multiset_insert 2\n";
+ return;
+ }
+
+ // wrapper for
+ // template<class InIt>
+ // void insert(InIt first, InIt last);
+ Multiset const const_c = build_assoc<Multiset>();
+ typename Multiset::size_type size = c.size();
+ phx::insert(arg1, const_c.begin(), const_c.end())(c);
+ if (test(c.size() != size + const_c.size())) {
+ cerr << "Failed " << typeid(Multiset).name()
+ << " test_multiset_insert 3\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_key_comp(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::key_comp;
+
+ typename Container::key_compare comp = key_comp(arg1)(c);
+
+ Container const const_c = c;
+ comp = key_comp(arg1)(const_c);
+}
+
+template <typename Container>
+void test_max_size(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::max_size;
+
+ Container const const_c = c;
+
+ typename Container::size_type s1 = max_size(arg1)(c);
+ if (test(s1 != c.max_size())) {
+ cerr << "Failed " << typeid(Container).name() << " test_max_size 1\n";
+ return;
+ }
+
+ typename Container::size_type s2 = max_size(arg1)(const_c);
+ if (test(s2 != const_c.max_size())) {
+ cerr << "Failed " << typeid(Container).name() << " test_max_size 2\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_pop_back(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::pop_back;
+
+ Container const const_c = c;
+
+ typename Container::size_type size = c.size();
+
+ pop_back(arg1)(c);
+ if (test(c.size() + 1 != size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_pop_back 1\n";
+ return;
+ }
+
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ pop_back(arg1)(const_c);
+#endif
+}
+
+template <typename Container>
+void test_pop_front(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::pop_front;
+
+ Container const const_c = c;
+
+ typename Container::size_type size = c.size();
+
+ pop_front(arg1)(c);
+ if (test(c.size() + 1 != size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_pop_front 1\n";
+ return;
+ }
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ pop_front(arg1)(const_c);
+#endif
+}
+
+template <typename Container>
+void test_push_back(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::push_back;
+
+ Container const const_c = c;
+
+ typename Container::value_type data = *c.begin();
+ typename Container::size_type size = c.size();
+ push_back(arg1, arg2)(c, data);
+ if (test(c.size() != size + 1)) {
+ cerr << "Failed " << typeid(Container).name() << " test_push_back 1\n";
+ return;
+ }
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ push_back(arg1, arg2)(const_c, data);
+#endif
+}
+
+template <typename Container>
+void test_push_front(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::push_front;
+
+ Container const const_c = c;
+
+ typename Container::value_type data = *c.begin();
+ typename Container::size_type size = c.size();
+ push_front(arg1, arg2)(c, data);
+ if (test(c.size() != size + 1)) {
+ cerr << "Failed " << typeid(Container).name() << " test_push_front 1\n";
+ return;
+ }
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ push_front(arg1, arg2)(const_c, data);
+#endif
+}
+
+template <typename Container>
+void test_rbegin(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::rbegin;
+
+ typename Container::reverse_iterator it1 = rbegin(arg1)(c);
+ typename Container::reverse_iterator it1_test = c.rbegin();
+ if (test(it1 != it1_test)) {
+ cerr << "Failed " << typeid(Container).name() << " test_rbegin 1\n";
+ return;
+ }
+ typename Container::const_reverse_iterator it2 = rbegin(arg1)(c);
+ typename Container::const_reverse_iterator it2_test = c.rbegin();
+ if (test(it2 != it2_test)) {
+ cerr << "Failed " << typeid(Container).name() << " test_rbegin 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::reverse_iterator it3 = rbegin(arg1)(const_c);
+#endif
+
+ typename Container::const_reverse_iterator it4 = rbegin(arg1)(const_c);
+ it2_test = const_c.rbegin();
+ if (test(it4 != it2_test)) {
+ cerr << "Failed " << typeid(Container).name() << " test_rbegin 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_rend(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::rend;
+
+ typename Container::reverse_iterator it1 = rend(arg1)(c);
+ typename Container::reverse_iterator it1_test = c.rend();
+ if (test(it1 != it1_test)) {
+ cerr << "Failed " << typeid(Container).name() << " test_rend 1\n";
+ return;
+ }
+ typename Container::const_reverse_iterator it2 = rend(arg1)(c);
+ typename Container::const_reverse_iterator it2_test = c.rend();
+ if (test(it2 != it2_test)) {
+ cerr << "Failed " << typeid(Container).name() << " test_rend 2\n";
+ return;
+ }
+
+ Container const const_c = c;
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ // Should not --- does not, Yay! --- compile.
+ typename Container::reverse_iterator it3 = rend(arg1)(const_c);
+#endif
+
+ typename Container::const_reverse_iterator it4 = rend(arg1)(const_c);
+ it2_test = const_c.rend();
+ if (test(it4 != it2_test)) {
+ cerr << "Failed " << typeid(Container).name() << " test_rend 4\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_reserve(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::reserve;
+
+ Container const const_c = c;
+
+ typename Container::size_type count = 2 * c.size();
+ reserve(arg1, count)(c);
+ if (test(c.capacity() < count)) {
+ cerr << "Failed " << typeid(Container).name() << " test_reserve 1\n";
+ return;
+ }
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ reserve(arg1, count)(const_c)(const_c);
+#endif
+}
+
+template <typename Container>
+void test_resize(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::resize;
+
+ Container const const_c = c;
+
+ typename Container::size_type new_size = 2 * c.size();
+ resize(arg1, new_size)(c);
+ if (test(c.size() != new_size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_resize 1\n";
+ return;
+ }
+
+ new_size = 2 * c.size();
+ typename Container::value_type value = *c.begin();
+ resize(arg1, new_size, value)(c);
+ if (test(c.size() != new_size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_resize 2\n";
+ return;
+ }
+#if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
+ new_size = 2 * const_c.size();
+ resize(arg1, new_size)(const_c);
+
+ new_size = 2 * const_c.size();
+ resize(arg1, new_size, value)(const_c);
+#endif
+}
+
+template <typename Container>
+void test_size(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::size;
+
+ Container const const_c = c;
+
+ typename Container::size_type s1 = size(arg1)(c);
+ if (test(s1 != c.size())) {
+ cerr << "Failed " << typeid(Container).name() << " test_size 1\n";
+ return;
+ }
+
+ typename Container::size_type s2 = size(arg1)(const_c);
+ if (test(s2 != const_c.size())) {
+ cerr << "Failed " << typeid(Container).name() << " test_size 2\n";
+ return;
+ }
+}
+
+template <typename Container>
+void test_splice(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::arg_names::arg2;
+ using phx::arg_names::arg3;
+ using phx::arg_names::arg4;
+ using phx::arg_names::arg5;
+ using phx::splice;
+
+ typename Container::iterator c_end;
+ typename Container::iterator c2_begin;
+ typename Container::iterator c2_end;
+ typename Container::size_type size = c.size();
+
+ Container const copy = c;
+ Container const copy2 = build_list();
+ Container c2 = copy2;
+
+ size = c.size();
+ c_end = c.end();
+ splice(arg1, arg2, arg3)(c, c_end, c2);
+ if (test(c.size() != 2 * size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_splice 1\n";
+ return;
+ }
+
+ c = copy;
+ c_end = c.end();
+ c2 = copy2;
+ c2_begin = c2.begin();
+ size = c.size() + 1;
+ splice(arg1, arg2, arg3, arg4)(c, c_end, c2, c2_begin);
+ if (test(c.size() != size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_splice 2\n";
+ return;
+ }
+
+ c = copy;
+ c_end = c.end();
+ c2 = copy2;
+ c2_begin = c2.begin();
+ c2_end = c2.end();
+ size = c.size() + c2.size();
+ /*
+ splice(arg1, arg2, arg3, arg4, arg5)(c, c_end, c2, c2_begin, c2_end);
+ if (test(c.size() != size)) {
+ cerr << "Failed " << typeid(Container).name() << " test_splice 3\n";
+ return;
+ }
+ */
+}
+
+template <typename Container>
+void test_value_comp(Container c)
+{
+ using phx::arg_names::arg1;
+ using phx::value_comp;
+
+ typename Container::value_compare comp = value_comp(arg1)(c);
+
+ Container const const_c = c;
+ comp = value_comp(arg1)(const_c);
+}
+
+#endif
diff --git a/src/boost/libs/phoenix/test/container/container_tests10a.cpp b/src/boost/libs/phoenix/test/container/container_tests10a.cpp
new file mode 100644
index 000000000..e7a060627
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests10a.cpp
@@ -0,0 +1,73 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_map<int, int> const build_unordered_map()
+{
+ typedef std::unordered_map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::unordered_multimap<int, int> const build_unordered_multimap()
+{
+ typedef std::unordered_map<int, int> int_map;
+ typedef std::unordered_multimap<int, int> int_multimap;
+ int_map const data = build_unordered_map();
+ return int_multimap(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::unordered_multimap<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_multimap<int, int> >::value));
+
+ std::unordered_multimap<int, int> const data = build_unordered_multimap();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_map_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests10b.cpp b/src/boost/libs/phoenix/test/container/container_tests10b.cpp
new file mode 100644
index 000000000..5ff194a93
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests10b.cpp
@@ -0,0 +1,74 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_map<int, int> const build_unordered_map()
+{
+ typedef std::unordered_map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::unordered_multimap<int, int> const build_unordered_multimap()
+{
+ typedef std::unordered_map<int, int> int_map;
+ typedef std::unordered_multimap<int, int> int_multimap;
+ int_map const data = build_unordered_map();
+ return int_multimap(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::unordered_multimap<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_multimap<int, int> >::value));
+
+ std::unordered_multimap<int, int> const data = build_unordered_multimap();
+ test_multimap_insert(data);
+ //test_key_comp(data);
+ test_max_size(data);
+ //test_rbegin(data);
+ //test_rend(data);
+ test_size(data);
+ //test_value_comp(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests11a.cpp b/src/boost/libs/phoenix/test/container/container_tests11a.cpp
new file mode 100644
index 000000000..b89c3c8f6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests11a.cpp
@@ -0,0 +1,59 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_set<int> const build_unordered_set()
+{
+ typedef std::unordered_set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::unordered_set<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_set<int> >::value));
+
+ std::unordered_set<int> const data = build_unordered_set();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_set_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests11b.cpp b/src/boost/libs/phoenix/test/container/container_tests11b.cpp
new file mode 100644
index 000000000..53e2be9c6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests11b.cpp
@@ -0,0 +1,60 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_set<int> const build_unordered_set()
+{
+ typedef std::unordered_set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::unordered_set<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_set<int> >::value));
+
+ std::unordered_set<int> const data = build_unordered_set();
+ test_set_insert(data);
+ //test_key_comp(data);
+ test_max_size(data);
+ //test_rbegin(data);
+ //test_rend(data);
+ test_size(data);
+ //test_value_comp(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests12a.cpp b/src/boost/libs/phoenix/test/container/container_tests12a.cpp
new file mode 100644
index 000000000..06c5d94ea
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests12a.cpp
@@ -0,0 +1,70 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_set<int> const build_unordered_set()
+{
+ typedef std::unordered_set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::unordered_multiset<int> const build_unordered_multiset()
+{
+ typedef std::unordered_set<int> int_set;
+ typedef std::unordered_multiset<int> int_multiset;
+ int_set const data = build_unordered_set();
+ return int_multiset(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::unordered_multiset<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_multiset<int> >::value));
+
+ std::unordered_multiset<int> const data = build_unordered_multiset();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_set_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests12b.cpp b/src/boost/libs/phoenix/test/container/container_tests12b.cpp
new file mode 100644
index 000000000..63f167c4a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests12b.cpp
@@ -0,0 +1,71 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_set<int> const build_unordered_set()
+{
+ typedef std::unordered_set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::unordered_multiset<int> const build_unordered_multiset()
+{
+ typedef std::unordered_set<int> int_set;
+ typedef std::unordered_multiset<int> int_multiset;
+ int_set const data = build_unordered_set();
+ return int_multiset(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::unordered_multiset<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_multiset<int> >::value));
+
+ std::unordered_multiset<int> const data = build_unordered_multiset();
+ test_multiset_insert(data);
+ //test_key_comp(data);
+ test_max_size(data);
+ //test_rbegin(data);
+ //test_rend(data);
+ test_size(data);
+ //test_value_comp(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests1a.cpp b/src/boost/libs/phoenix/test/container/container_tests1a.cpp
new file mode 100644
index 000000000..a4b1442be
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests1a.cpp
@@ -0,0 +1,49 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+
+std::list<int> const build_list()
+{
+ std::vector<int> const data = build_vector();
+ return std::list<int>(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::list<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::list<int> >::value));
+
+ std::list<int> const data = build_list();
+ test_assign(data);
+ test_assign2(data);
+ test_back(data);
+ test_begin(data);
+ test_clear(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests1b.cpp b/src/boost/libs/phoenix/test/container/container_tests1b.cpp
new file mode 100644
index 000000000..245fe0c3c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests1b.cpp
@@ -0,0 +1,51 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+
+std::list<int> const build_list()
+{
+ std::vector<int> const data = build_vector();
+ return std::list<int>(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::list<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::list<int> >::value));
+
+ std::list<int> const data = build_list();
+ test_empty(data);
+ test_end(data);
+ test_erase(data);
+ test_front(data);
+ test_get_allocator(data);
+ test_insert(data);
+ test_max_size(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests2a.cpp b/src/boost/libs/phoenix/test/container/container_tests2a.cpp
new file mode 100644
index 000000000..757444a70
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests2a.cpp
@@ -0,0 +1,49 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+
+std::list<int> const build_list()
+{
+ std::vector<int> const data = build_vector();
+ return std::list<int>(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::list<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::list<int> >::value));
+
+ std::list<int> const data = build_list();
+ test_pop_back(data);
+ test_pop_front(data);
+ test_push_back(data);
+ test_push_front(data);
+ return boost::report_errors();
+}
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests2b.cpp b/src/boost/libs/phoenix/test/container/container_tests2b.cpp
new file mode 100644
index 000000000..c0e481903
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests2b.cpp
@@ -0,0 +1,50 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+
+std::list<int> const build_list()
+{
+ std::vector<int> const data = build_vector();
+ return std::list<int>(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::list<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::list<int> >::value));
+
+ std::list<int> const data = build_list();
+ test_rbegin(data);
+ test_rend(data);
+ test_resize(data);
+ test_size(data);
+ test_splice(data);
+ return boost::report_errors();
+}
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests3a.cpp b/src/boost/libs/phoenix/test/container/container_tests3a.cpp
new file mode 100644
index 000000000..348b65524
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests3a.cpp
@@ -0,0 +1,61 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::map<int, int> const build_map()
+{
+ typedef std::map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::map<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::map<int, int> >::value));
+
+ std::map<int, int> const data = build_map();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_map_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests3b.cpp b/src/boost/libs/phoenix/test/container/container_tests3b.cpp
new file mode 100644
index 000000000..98c3c65a4
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests3b.cpp
@@ -0,0 +1,62 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::map<int, int> const build_map()
+{
+ typedef std::map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::map<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::map<int, int> >::value));
+
+ std::map<int, int> const data = build_map();
+ test_map_insert(data);
+ test_key_comp(data);
+ test_max_size(data);
+ test_rbegin(data);
+ test_rend(data);
+ test_size(data);
+ test_value_comp(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests4a.cpp b/src/boost/libs/phoenix/test/container/container_tests4a.cpp
new file mode 100644
index 000000000..3d252d7c8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests4a.cpp
@@ -0,0 +1,50 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::vector<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::vector<int> >::value));
+
+ std::vector<int> const data = build_vector();
+ test_assign(data);
+ test_assign2(data);
+ test_at(data);
+ test_back(data);
+ test_begin(data);
+ test_capacity(data);
+ test_clear(data);
+ test_end(data);
+ test_empty(data);
+ test_erase(data);
+ test_front(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests4b.cpp b/src/boost/libs/phoenix/test/container/container_tests4b.cpp
new file mode 100644
index 000000000..07059b389
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests4b.cpp
@@ -0,0 +1,49 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::vector<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::vector<int> >::value));
+
+ std::vector<int> const data = build_vector();
+ test_get_allocator(data);
+ test_insert(data);
+ test_max_size(data);
+ test_pop_back(data);
+ test_push_back(data);
+ test_rbegin(data);
+ test_rend(data);
+ test_reserve(data);
+ test_resize(data);
+ test_size(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests5a.cpp b/src/boost/libs/phoenix/test/container/container_tests5a.cpp
new file mode 100644
index 000000000..983913a47
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests5a.cpp
@@ -0,0 +1,56 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+
+std::deque<int> const build_deque()
+{
+ std::vector<int> const data = build_vector();
+ return std::deque<int>(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::deque<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::deque<int> >::value));
+
+ std::deque<int> const data = build_deque();
+ test_assign(data);
+ test_assign2(data);
+ test_at(data);
+ test_back(data);
+ test_begin(data);
+ test_clear(data);
+ test_front(data);
+ test_empty(data);
+ test_end(data);
+ test_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests5b.cpp b/src/boost/libs/phoenix/test/container/container_tests5b.cpp
new file mode 100644
index 000000000..d08a70168
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests5b.cpp
@@ -0,0 +1,55 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+
+std::deque<int> const build_deque()
+{
+ std::vector<int> const data = build_vector();
+ return std::deque<int>(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::deque<int> >::value));
+ BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::deque<int> >::value));
+
+ std::deque<int> const data = build_deque();
+ test_insert(data);
+ test_max_size(data);
+ test_pop_back(data);
+ test_pop_front(data);
+ test_push_back(data);
+ test_push_front(data);
+ test_rbegin(data);
+ test_rend(data);
+ test_resize(data);
+ test_size(data);
+ return boost::report_errors();
+}
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests6a.cpp b/src/boost/libs/phoenix/test/container/container_tests6a.cpp
new file mode 100644
index 000000000..62c8af187
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests6a.cpp
@@ -0,0 +1,72 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::map<int, int> const build_map()
+{
+ typedef std::map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::multimap<int, int> const build_multimap()
+{
+ typedef std::map<int, int> int_map;
+ typedef std::multimap<int, int> int_multimap;
+ int_map const data = build_map();
+ return int_multimap(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::multimap<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::multimap<int, int> >::value));
+
+ std::multimap<int, int> const data = build_multimap();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_map_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests6b.cpp b/src/boost/libs/phoenix/test/container/container_tests6b.cpp
new file mode 100644
index 000000000..193f4bf42
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests6b.cpp
@@ -0,0 +1,73 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::map<int, int> const build_map()
+{
+ typedef std::map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::multimap<int, int> const build_multimap()
+{
+ typedef std::map<int, int> int_map;
+ typedef std::multimap<int, int> int_multimap;
+ int_map const data = build_map();
+ return int_multimap(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::multimap<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::multimap<int, int> >::value));
+
+ std::multimap<int, int> const data = build_multimap();
+ test_multimap_insert(data);
+ test_key_comp(data);
+ test_max_size(data);
+ test_rbegin(data);
+ test_rend(data);
+ test_size(data);
+ test_value_comp(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests7a.cpp b/src/boost/libs/phoenix/test/container/container_tests7a.cpp
new file mode 100644
index 000000000..b82b4cf11
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests7a.cpp
@@ -0,0 +1,59 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::set<int> const build_set()
+{
+ typedef std::set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::set<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::set<int> >::value));
+
+ std::set<int> const data = build_set();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_set_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests7b.cpp b/src/boost/libs/phoenix/test/container/container_tests7b.cpp
new file mode 100644
index 000000000..a79be9e92
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests7b.cpp
@@ -0,0 +1,60 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::set<int> const build_set()
+{
+ typedef std::set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::set<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::set<int> >::value));
+
+ std::set<int> const data = build_set();
+ test_set_insert(data);
+ test_key_comp(data);
+ test_max_size(data);
+ test_rbegin(data);
+ test_rend(data);
+ test_size(data);
+ test_value_comp(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests8a.cpp b/src/boost/libs/phoenix/test/container/container_tests8a.cpp
new file mode 100644
index 000000000..95e85b832
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests8a.cpp
@@ -0,0 +1,70 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::set<int> const build_set()
+{
+ typedef std::set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::multiset<int> const build_multiset()
+{
+ typedef std::set<int> int_set;
+ typedef std::multiset<int> int_multiset;
+ int_set const data = build_set();
+ return int_multiset(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::multiset<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::multiset<int> >::value));
+
+ std::multiset<int> const data = build_multiset();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_set_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests8b.cpp b/src/boost/libs/phoenix/test/container/container_tests8b.cpp
new file mode 100644
index 000000000..b20ed5d3f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests8b.cpp
@@ -0,0 +1,71 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::set<int> const build_set()
+{
+ typedef std::set<int> int_set;
+ typedef std::vector<int> int_vector;
+
+ int_set result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ result.insert(it, end);
+ return result;
+}
+
+std::multiset<int> const build_multiset()
+{
+ typedef std::set<int> int_set;
+ typedef std::multiset<int> int_multiset;
+ int_set const data = build_set();
+ return int_multiset(data.begin(), data.end());
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::multiset<int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::multiset<int> >::value));
+
+ std::multiset<int> const data = build_multiset();
+ test_multiset_insert(data);
+ test_key_comp(data);
+ test_max_size(data);
+ test_rbegin(data);
+ test_rend(data);
+ test_size(data);
+ test_value_comp(data);
+ return boost::report_errors();
+}
+
+
+
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests9a.cpp b/src/boost/libs/phoenix/test/container/container_tests9a.cpp
new file mode 100644
index 000000000..5711c49db
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests9a.cpp
@@ -0,0 +1,62 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_map<int, int> const build_unordered_map()
+{
+ typedef std::unordered_map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::unordered_map<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_map<int, int> >::value));
+
+ std::unordered_map<int, int> const data = build_unordered_map();
+ test_begin(data);
+ test_clear(data);
+ test_empty(data);
+ test_end(data);
+ test_map_erase(data);
+ test_get_allocator(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/container/container_tests9b.cpp b/src/boost/libs/phoenix/test/container/container_tests9b.cpp
new file mode 100644
index 000000000..fcc2d56f2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/container/container_tests9b.cpp
@@ -0,0 +1,63 @@
+/*=============================================================================
+ Copyright (c) 2004 Angus Leeming
+ Copyright (c) 2017 Kohei Takahashi
+
+ 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 "container_tests.hpp"
+#include <boost/static_assert.hpp>
+
+std::unordered_map<int, int> const build_unordered_map()
+{
+ typedef std::unordered_map<int, int> int_map;
+ typedef std::vector<int> int_vector;
+
+ int_map result;
+ int_vector const data = build_vector();
+ int_vector::const_iterator it = data.begin();
+ int_vector::const_iterator const end = data.end();
+ for (; it != end; ++it) {
+ int const value = *it;
+ result[value] = 100 * value;
+ }
+ return result;
+}
+
+std::vector<int> const init_vector()
+{
+ typedef std::vector<int> int_vector;
+ int const data[] = { -4, -3, -2, -1, 0 };
+ int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]);
+ return int_vector(data, data + data_size);
+}
+
+std::vector<int> const build_vector()
+{
+ typedef std::vector<int> int_vector;
+ static int_vector data = init_vector();
+ int_vector::size_type const size = data.size();
+ int_vector::iterator it = data.begin();
+ int_vector::iterator const end = data.end();
+ for (; it != end; ++it)
+ *it += size;
+ return data;
+}
+
+int
+main()
+{
+ BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::unordered_map<int, int> >::value));
+ BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_map<int, int> >::value));
+
+ std::unordered_map<int, int> const data = build_unordered_map();
+ test_map_insert(data);
+ //test_key_comp(data);
+ test_max_size(data);
+ //test_rbegin(data);
+ //test_rend(data);
+ test_size(data);
+ //test_value_comp(data);
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/core/custom_terminal.cpp b/src/boost/libs/phoenix/test/core/custom_terminal.cpp
new file mode 100644
index 000000000..e8b3a5d9b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/core/custom_terminal.cpp
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+
+ 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/log/detail/custom_terminal_spec.hpp>
+
+int
+main()
+{
+}
diff --git a/src/boost/libs/phoenix/test/core/intel_test.cpp b/src/boost/libs/phoenix/test/core/intel_test.cpp
new file mode 100644
index 000000000..c2364c86b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/core/intel_test.cpp
@@ -0,0 +1,29 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+
+#include <boost/phoenix/core/argument.hpp>
+#include <boost/phoenix/core/value.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::phoenix::val;
+
+int
+main()
+{
+#ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS
+ using boost::phoenix::arg_names::_1;
+#else
+ boost::phoenix::arg_names::_1_type _1;
+#endif
+
+ int i1 = 1;
+
+ BOOST_TEST(val(_1)(i1) == i1);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/core/primitives_tests.cpp b/src/boost/libs/phoenix/test/core/primitives_tests.cpp
new file mode 100644
index 000000000..c9813863a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/core/primitives_tests.cpp
@@ -0,0 +1,85 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <string>
+
+#include <boost/phoenix/core/argument.hpp>
+#include <boost/phoenix/core/reference.hpp>
+#include <boost/phoenix/core/value.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::phoenix::cref;
+using boost::phoenix::ref;
+using boost::phoenix::val;
+
+
+int
+main()
+{
+#ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+#else
+ boost::phoenix::arg_names::_1_type _1;
+ boost::phoenix::arg_names::arg1_type arg1;
+ boost::phoenix::arg_names::arg2_type arg2;
+#endif
+ char c1 = '1';
+ int i1 = 1, i2 = 2, i = 4;
+ const char* s2 = "2";
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ //
+ // Values, references and arguments
+ //
+ ///////////////////////////////////////////////////////////////////////////
+
+ // argument
+ BOOST_TEST(arg1(c1) == c1);
+ BOOST_TEST(arg1(i1, i2) == i1);
+ BOOST_TEST(arg2(i1, s2) == s2);
+ BOOST_TEST(&(arg1(c1)) == &c1); // must be an lvalue
+
+ // value
+ val(' ')();
+ val(" ")();
+ std::cout << val("Hello,")() << val(' ')() << val("World")() << std::endl;
+ BOOST_TEST(val(3)() == 3);
+ BOOST_TEST(val("Hello, world")() == std::string("Hello, world"));
+ BOOST_TEST(val(_1)(i1) == i1);
+
+ // should not compile:
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ &val(_1)(i1); // should return an rvalue
+#endif
+
+ // reference
+ BOOST_TEST(cref(i)() == ref(i)());
+ BOOST_TEST(cref(i)() == 4);
+ BOOST_TEST(i == 4);
+ BOOST_TEST(ref(++i)() == 5);
+ BOOST_TEST(i == 5);
+
+ // should not compile:
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ ref(arg1);
+#endif
+
+ // testing consts
+ int const ic = 123;
+ BOOST_TEST(arg1(ic) == 123);
+
+ // should not compile:
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ arg1();
+#endif
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/adapt_function.cpp b/src/boost/libs/phoenix/test/function/adapt_function.cpp
new file mode 100644
index 000000000..77cca41d8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/adapt_function.cpp
@@ -0,0 +1,84 @@
+/*=============================================================================
+ Copyright (c) 2011 Thomas Heller
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ ==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function.hpp>
+
+namespace impl
+{
+ void
+ test()
+ {
+ std::cout << "Test adapting functions...\n";
+ }
+
+ int
+ negate(int n)
+ {
+ return -n;
+ }
+
+ int
+ plus(int a, int b)
+ {
+ return a + b;
+ }
+
+ template <typename T>
+ T
+ plus(T a, T b, T c)
+ {
+ return a + b + c;
+ }
+
+ int
+ plus4(int a, int b, int c, int d)
+ {
+ return a + b + c + d;
+ }
+}
+
+BOOST_PHOENIX_ADAPT_FUNCTION_NULLARY(void, test, impl::test)
+BOOST_PHOENIX_ADAPT_FUNCTION(int, negate, impl::negate, 1)
+BOOST_PHOENIX_ADAPT_FUNCTION(int, plus, impl::plus, 2)
+BOOST_PHOENIX_ADAPT_FUNCTION(
+ typename boost::remove_reference<A0>::type
+ , plus
+ , impl::plus
+ , 3
+)
+BOOST_PHOENIX_ADAPT_FUNCTION(int, plus4, impl::plus4, 4)
+
+// Test of solution to bug when using namespace
+using namespace boost::phoenix;
+
+BOOST_PHOENIX_ADAPT_FUNCTION_NULLARY(void, test2, impl::test)
+BOOST_PHOENIX_ADAPT_FUNCTION(int, negate2, impl::negate, 1)
+
+
+int
+main()
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+
+ int a = 123;
+ int b = 256;
+
+ test()();
+ test2()();
+ BOOST_TEST(::negate(arg1)(a) == -a);
+ BOOST_TEST(::negate2(arg1)(a) == -a);
+ BOOST_TEST(::plus(arg1, arg2)(a, b) == a+b);
+ BOOST_TEST(::plus(arg1, arg2, 3)(a, b) == a+b+3);
+ BOOST_TEST(plus4(arg1, arg2, 3, 4)(a, b) == a+b+3+4);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/function_tests.cpp b/src/boost/libs/phoenix/test/function/function_tests.cpp
new file mode 100644
index 000000000..6f979fafe
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/function_tests.cpp
@@ -0,0 +1,140 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ ==============================================================================*/
+
+#include <iostream>
+#include <cmath>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+
+#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#include <boost/mpl/multiplies.hpp>
+#undef BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+struct test_impl
+{
+ typedef void result_type;
+ void operator()() const
+ {
+ std::cout << "Test lazy functions...\n";
+ }
+};
+
+boost::phoenix::function<test_impl> test;
+
+struct sqr_impl
+{
+ template <typename Signature>
+ struct result;
+
+ template <typename This, typename Arg>
+ struct result<This(Arg)>
+ {
+ typedef typename boost::remove_reference<Arg>::type type;
+ };
+
+ template <typename Arg>
+ Arg
+ operator()(Arg n) const
+ {
+ return n * n;
+ }
+};
+
+boost::phoenix::function<sqr_impl> sqr;
+
+struct fact_impl
+{
+ template <typename Signature>
+ struct result;
+
+ template <typename This, typename Arg>
+ struct result<This(Arg)>
+ {
+ typedef typename boost::remove_reference<Arg>::type type;
+ };
+
+ template <typename Arg>
+ Arg
+ operator()(Arg n) const
+ {
+ return (n <= 0) ? 1 : n * (*this)(n-1);
+ }
+};
+
+boost::phoenix::function<fact_impl> fact;
+
+struct pow_impl
+{
+
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Arg1, typename Arg2>
+ struct result<This(Arg1, Arg2)>
+ {
+ typedef typename boost::remove_reference<Arg1>::type type;
+ };
+
+ template <typename Arg1, typename Arg2>
+ Arg1
+ operator()(Arg1 a, Arg2 b) const
+ {
+ return std::pow(a, b);
+ }
+};
+
+boost::phoenix::function<pow_impl> power;
+
+struct add_impl
+{
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ struct result<This(Arg1, Arg2, Arg3, Arg4)>
+ {
+ typedef typename boost::remove_reference<Arg1>::type type;
+ };
+
+ template <typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ Arg1
+ operator()(Arg1 a, Arg2 b, Arg3 c, Arg4 d) const
+ {
+ return a + b + c + d;
+ }
+};
+
+boost::phoenix::function<add_impl> add;
+
+int
+main()
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+
+ int i5 = 5;
+ double d5 = 5, d3 = 3;
+
+ test()();
+ BOOST_TEST(sqr(arg1)(i5) == (i5*i5));
+ BOOST_TEST(fact(4)() == 24);
+ BOOST_TEST(fact(arg1)(i5) == 120);
+ BOOST_TEST((int)power(arg1, arg2)(d5, d3) == (int)std::pow(d5, d3));
+ BOOST_TEST((sqr(arg1) + 5)(i5) == ((i5*i5)+5));
+ BOOST_TEST(add(arg1, arg1, arg1, arg1)(i5) == (5+5+5+5));
+
+ // testing composition
+ BOOST_TEST(add(arg1, arg1, arg1, power(arg1, 2))(d5) == (5+5+5+25));
+
+ int const ic5 = 5;
+ // testing consts
+ BOOST_TEST(sqr(arg1)(ic5) == (ic5*ic5));
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_argument_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_argument_tests.cpp
new file mode 100644
index 000000000..a45f501f1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_argument_tests.cpp
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_argument_tests.cpp
+//
+// lazy argument tests passing lazy function as argument.
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function.hpp>
+
+namespace example {
+ struct G {
+
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename A0>
+ struct result<This(A0)>
+ : boost::remove_reference<A0>
+ {};
+
+ template <typename T>
+ T operator()(T t) const { return ++t; }
+
+ };
+}
+
+typedef boost::phoenix::function<example::G> GG;
+boost::phoenix::function<example::G> gg;
+
+template <typename F,typename T>
+T h(F f, T const& t)
+{
+ return f(t)();
+}
+
+int main()
+{
+ BOOST_TEST( h(gg,1) == 2);
+ BOOST_TEST(( h<GG,int>(gg,1) == 2));
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_compose_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_compose_tests.cpp
new file mode 100644
index 000000000..ea031e32c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_compose_tests.cpp
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_compose_tests.cpp
+//
+// tests on compose
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using namespace phx;
+
+ BOOST_TEST(compose(id,id)(arg1)(1) == 1);
+ BOOST_TEST(compose(id,id)(1)() == 1);
+ BOOST_TEST(compose(inc,inc)(arg1)(1) == 3);
+ BOOST_TEST(compose(inc,plus)(arg1,arg2)(2,3) == 6);
+ BOOST_TEST(compose(plus,inc,dec)(arg1)(1) == 2);
+ BOOST_TEST(compose(plus,plus,minus)(arg1,arg2)(3,1) == 6);
+
+
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_fold_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_fold_tests.cpp
new file mode 100644
index 000000000..5c542575d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_fold_tests.cpp
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_fold_tests.cpp
+//
+// tests on foldl foldr and compose
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ using namespace phx;
+
+ list<int> l = enum_from(2);
+ list<int> evens = filter(even,l);
+ list<int> even4 = take(4,evens)();
+
+ BOOST_TEST(foldr(plus,0,even4)() == 20);
+ BOOST_TEST(foldr(multiplies,1,even4)() == 384);
+ BOOST_TEST(foldr1(plus,even4)() == 20 );
+ BOOST_TEST(foldl(plus,arg1,even4)(0) == 20);
+ BOOST_TEST(foldl1(plus,even4)() == 20);
+ BOOST_TEST(compose(inc,foldr)(plus,0,even4)() == 21);
+ BOOST_TEST(compose(plus,foldl,foldr)(arg1,arg2,arg3)(plus,0,even4) == 40);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_list2_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_list2_tests.cpp
new file mode 100644
index 000000000..c294a8f89
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_list2_tests.cpp
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_list2_tests.cpp
+//
+// more tests on list<T>
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using namespace phx;
+
+ list<int> l0;
+ list<int> l1 = list_with<>()(1,2,3,4,5);
+ list<int> l2 = all_but_last(l1)();
+
+ BOOST_TEST(null(l0)());
+ BOOST_TEST(head(l1)() == 1);
+ BOOST_TEST(head(tail(l1))() == 2);
+ BOOST_TEST(last(l1)() == 5);
+ BOOST_TEST(last(l2)() == 4);
+ BOOST_TEST(head(drop(2,l2))() == 3);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_list3_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_list3_tests.cpp
new file mode 100644
index 000000000..9e4bc6d0d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_list3_tests.cpp
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_list3_tests.cpp
+//
+// more tests on list<T>
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ //using boost::phoenix::arg_names::arg1;
+ //using boost::phoenix::arg_names::arg2;
+ using namespace phx;
+
+ list<int> l = enum_from(2);
+ list<int> ll = take(4,l);
+ list<int> lll = take(12,l);
+ list<int> l2 = enum_from_to(2,10);
+ list<int> ll2 = take(4,l2);
+ list<int> lll2 = take(12,l2);
+ list<int> evens = filter(even,l);
+ list<int> odds = filter(odd,l);
+ list<int> even4 = take(4,evens)();
+ list<int> odd4 = take(4,odds)();
+ list<int> itersome = take(4,iterate(dec,1))();
+ list<int> repeatsome = take(4,repeat(1))();
+
+ BOOST_TEST(last(ll)() == 5);
+ BOOST_TEST(last(lll)() == 13);
+ BOOST_TEST(last(ll2)() == 5);
+ BOOST_TEST(last(lll2)() == 10);
+ BOOST_TEST(length(lll2)() == 9);
+ BOOST_TEST(at_(even4,3)() == 8);
+ BOOST_TEST(at_(odd4,2)() == 7);
+ BOOST_TEST(at_(itersome,3)() == -3);
+ BOOST_TEST(at_(repeatsome,3)() == 1);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_list_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_list_tests.cpp
new file mode 100644
index 000000000..47caf6496
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_list_tests.cpp
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_list_tests.cpp
+//
+// tests on list<T>
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using phx::null;
+ using phx::list;
+ using phx::head;
+ using phx::tail;
+ using phx::cons;
+ using phx::cat;
+ using phx::take;
+ using phx::NIL;
+
+ list<int> l0;
+ list<int> l1 = cons(1,l0);
+ list<int> l2 = cons(2,l1);
+ list<int> l3 = cons(3,l2);
+ list<int> l4 = cons(4,l3);
+ list<int> l5 = cons(5,NIL);
+ list<int> l6 = take(2,l4)();
+ list<int> l7 = cons(7,take(2,l4));
+ list<int> l8 = take(1,take(3,l4))();
+
+ BOOST_TEST(null(l0)());
+ BOOST_TEST(null(arg1)(l0));
+ BOOST_TEST(head(l1)() == 1);
+ BOOST_TEST(head(arg1)(l1) == 1);
+ BOOST_TEST(head(tail(l2))() == 1);
+ BOOST_TEST(head(tail(arg1))(l2) == 1);
+ BOOST_TEST(head(tail(tail(l3)))() == 1);
+ BOOST_TEST(head(tail(tail(arg1)))(l3) == 1);
+ BOOST_TEST(head(tail(tail(l4)))() == 2);
+ BOOST_TEST(head(tail(tail(arg1)))(l4) == 2);
+ BOOST_TEST(head(l5)() == 5);
+ BOOST_TEST(head(arg1)(l5) == 5);
+ BOOST_TEST(head(tail(l6))() == 3);
+ BOOST_TEST(head(tail(arg1))(l6) == 3);
+ BOOST_TEST(head(tail(l7))() == 4);
+ BOOST_TEST(head(tail(arg1))(l7) == 4);
+ BOOST_TEST(head(l8)() == 4);
+ BOOST_TEST(head(arg1)(l8) == 4);
+
+ list<int> l9 = cat(l8,take(2,l4));
+ list<int> l10 = cat(l8,NIL);
+ list<int> l11 = cat(l0,l7);
+ list<int> l12 = cat(l10,l8);
+
+ BOOST_TEST(head(tail(l9))() == 4);
+ BOOST_TEST(head(l10)() == 4);
+ BOOST_TEST(head(arg1)(l11) == 7);
+ BOOST_TEST(head(l12)() == 4);
+
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_make_pair_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_make_pair_tests.cpp
new file mode 100644
index 000000000..09fccf5c2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_make_pair_tests.cpp
@@ -0,0 +1,109 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_make_pair_tests.cpp
+//
+// lazy make_pair test solving the optimizer problem.
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function.hpp>
+
+namespace boost {
+
+ namespace phoenix {
+
+#ifdef BOOST_RESULT_OF_USE_TR1
+
+ namespace result_of {
+
+ template <
+ typename Arg1
+ , typename Arg2
+ >
+ class make_pair
+ {
+ public:
+ typedef typename boost::remove_reference<Arg1>::type Arg1Type;
+ typedef typename boost::remove_reference<Arg2>::type Arg2Type;
+ typedef std::pair<Arg1Type,Arg2Type> type;
+ };
+ }
+#endif
+
+ namespace impl
+ {
+
+ struct make_pair {
+
+
+#ifdef BOOST_RESULT_OF_USE_TR1
+ template <typename Sig>
+ struct result;
+ // This fails with -O2 unless refs are removed from A1 and A2.
+ template <typename This, typename A0, typename A1>
+ struct result<This(A0, A1)>
+ {
+ typedef typename result_of::make_pair<A0,A1>::type type;
+ };
+#else
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename A0, typename A1>
+ struct result<This(A0, A1)>
+ : boost::remove_reference<std::pair<A0, A1> >
+ {};
+
+#endif
+
+
+ template <typename A0, typename A1>
+#ifdef BOOST_RESULT_OF_USE_TR1
+ typename result<make_pair(A0,A1)>::type
+#else
+ std::pair<A0, A1>
+#endif
+ operator()(A0 const & a0, A1 const & a1) const
+ {
+ return std::make_pair(a0,a1);
+ }
+
+ };
+ }
+
+BOOST_PHOENIX_ADAPT_CALLABLE(make_pair, impl::make_pair, 2)
+
+ }
+
+}
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ int a = 99; int b = 256;
+
+ std::pair<int,int> ab1 = phx::make_pair(a,b)();
+ //std::cout << ab1.first << "," << ab1.second << std::endl;
+ BOOST_TEST(ab1.first == 99 && ab1.second == 256);
+ std::pair<int,int> ab2 = phx::make_pair(arg1,b)(a);
+ //std::cout << ab2.first << "," << ab2.second << std::endl;
+ BOOST_TEST(ab2.first == 99 && ab2.second == 256);
+ std::pair<int,int> ab3 = phx::make_pair(arg1,arg2)(a,b);
+ //std::cout << ab3.first << "," << ab3.second << std::endl;
+ BOOST_TEST(ab3.first == 99 && ab3.second == 256);
+
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_operator_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_operator_tests.cpp
new file mode 100644
index 000000000..ef05717c8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_operator_tests.cpp
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_operator_tests.cpp
+//
+// lazy operator tests
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_operator.hpp>
+
+
+int main()
+{
+ using boost::phoenix::plus;
+ using boost::phoenix::minus;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+
+ int a = 123;
+ int b = 256;
+
+ BOOST_TEST(plus(arg1, arg2)(a, b) == a+b);
+ BOOST_TEST(plus(arg1, arg2, 3)(a, b) == a+b+3);
+ BOOST_TEST(plus(arg1, b)(a) == a+b);
+ BOOST_TEST(plus(a, arg2)(a,b) == a+b);
+ BOOST_TEST(plus(a, arg1)(b) == a+b);
+ BOOST_TEST(plus(a, b)() == a+b);
+ BOOST_TEST(minus(a, b)() == a-b);
+ BOOST_TEST(plus(minus(a, b),b)() == a);
+ BOOST_TEST(plus(minus(arg1, b),b)(a) == a);
+ BOOST_TEST(plus(minus(arg1, arg2),b)(a,b) == a);
+ BOOST_TEST(plus(minus(arg1, arg2),arg2)(a,b) ==a);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_ptr_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_ptr_tests.cpp
new file mode 100644
index 000000000..22b1f1576
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_ptr_tests.cpp
@@ -0,0 +1,110 @@
+//////////////////////////////////////////////////////////////////
+//
+// lazy_ptr_tests.cpp
+//
+// Tests for ptr_to_fun, ptr_to_fun0 and ptr_to_mem_fun.
+//
+//
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#include <iostream>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+
+using namespace boost::phoenix;
+
+using std::cout;
+using std::endl;
+
+namespace example {
+
+ int footle()
+ {
+ return 0;
+ }
+
+ int foobar(int x)
+ {
+ return 2*x;
+ }
+
+ int foxy(int x,int y)
+ {
+ return x*y;
+ }
+
+ int foxyz(int x,int y,int z)
+ {
+ return x*y + z;
+ }
+
+ int fwxyz(int w,int x,int y,int z)
+ {
+ return w + x*y + z;
+ }
+
+}
+
+struct O {
+ int aa;
+ O( int a ) : aa(a) {}
+ int cf( int x ) const { return x+1; }
+ int f( int x ) { return ++aa + x; }
+ int a() const { return aa; }
+};
+
+
+int main() {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ using boost::phoenix::arg_names::arg4;
+
+ BOOST_TEST( ptr_to_fun0(&example::footle)()() == 0 );
+ BOOST_TEST( ptr_to_fun(&example::foobar)(arg1)(1) == 2 );
+ BOOST_TEST( ptr_to_fun(&example::foxy)(arg1,arg2)(2,3) == 6 );
+ BOOST_TEST( ptr_to_fun(&example::foxyz)(arg1,arg2,arg3)(2,3,4) == 10 );
+ BOOST_TEST( ptr_to_fun(&example::fwxyz)(arg1,arg2,arg3,arg4)(1,2,3,4) == 11);
+
+ O o(1);
+ BOOST_TEST( ptr_to_mem_fun( &O::a )( &o )() == 1 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( &o, 1 )() == 2 );
+ BOOST_TEST( ptr_to_mem_fun( &O::f )( &o, 1 )() == 3 );
+ BOOST_TEST( ptr_to_mem_fun( &O::f )( &o, 1 )() == 4 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( &o, 1 )() == 2 );
+
+ O oo(1);
+ BOOST_TEST( ptr_to_mem_fun( &O::a )( arg1 )( &oo ) == 1 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( &oo, arg1 )(1) == 2 );
+ BOOST_TEST( ptr_to_mem_fun( &O::f )( &oo, arg1 )(1) == 3 );
+ BOOST_TEST( ptr_to_mem_fun( &O::f )( &oo, arg1 )(1) == 4 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( &oo, arg1 )(1) == 2 );
+
+ const O p(1);
+ BOOST_TEST( ptr_to_mem_fun( &O::a )( &p )() == 1 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( &p, 1 )() == 2 );
+
+ boost::shared_ptr<O> r( new O(3) );
+ BOOST_TEST( ptr_to_mem_fun( &O::a )( r )() == 3 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( r, 1 )() == 2 );
+ BOOST_TEST( ptr_to_mem_fun( &O::f )( r, 1 )() == 5 );
+ BOOST_TEST( ptr_to_mem_fun( &O::f )( r, 1 )() == 6 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( r, 1 )() == 2 );
+
+ boost::shared_ptr<const O> s( new O(3) );
+ BOOST_TEST( ptr_to_mem_fun( &O::a )( s )() == 3 );
+ BOOST_TEST( ptr_to_mem_fun( &O::cf )( s, 1 )() == 2 );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_scan_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_scan_tests.cpp
new file mode 100644
index 000000000..0567951b5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_scan_tests.cpp
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_scan_tests.cpp
+//
+// tests on scanl scanr map zip and zip_with
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+
+int main()
+{
+ namespace phx = boost::phoenix;
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+ using boost::phoenix::arg_names::arg3;
+ using namespace phx;
+
+ list<int> l = enum_from(2);
+ list<int> evens = filter(even,l);
+ list<int> odds = filter(odd,l);
+ list<int> even4 = take(4,evens)();
+ list<int> odd4 = take(4,odds)();
+
+ BOOST_TEST(head(scanr(plus,0,even4))() == 20);
+ BOOST_TEST(last(scanl(plus,0,even4))() == 20);
+ BOOST_TEST(head(scanr1(plus,even4))() == 20);
+ BOOST_TEST(last(scanl1(plus,even4))() == 20);
+
+ list<int> map_result = map(inc,even4)();
+ list<int> zip_with_result = zip_with(plus,even4,odd4)();
+
+ BOOST_TEST(foldl1(plus,map_result)() == 24);
+ BOOST_TEST(last(zip_with_result)() == 17);
+
+ typedef std::pair<int,int> pair_ii;
+ list<pair_ii> zip_result1 = zip_with(make_pair,even4,odd4)();
+ list<pair_ii> zip_result2 = zip(even4,odd4)();
+
+ BOOST_TEST(head(zip_result1)().first == 2);
+ BOOST_TEST(last(zip_result2)().second == 9);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_templated_struct_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_templated_struct_tests.cpp
new file mode 100644
index 000000000..b7c990435
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_templated_struct_tests.cpp
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////
+// lazy_templated_struct_tests.cpp
+//
+// lazy templated struct test to check this works everywhere.
+//
+////////////////////////////////////////////////////////////////////////////
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/function.hpp>
+
+namespace example {
+
+ namespace impl {
+ // Example of templated struct.
+ template <typename Result>
+ struct what {
+
+ typedef Result result_type;
+
+ Result operator()(Result const & r) const
+ {
+ return r;
+ }
+ };
+
+ template <typename Result>
+ struct what0 {
+
+ typedef Result result_type;
+
+ Result operator()() const
+ {
+ return Result(100);
+ }
+
+ };
+
+ }
+
+ boost::function1<int, int > what_int = impl::what<int>();
+ boost::function0<int> what0_int = impl::what0<int>();
+ BOOST_PHOENIX_ADAPT_FUNCTION(int,what,what_int,1)
+ BOOST_PHOENIX_ADAPT_FUNCTION_NULLARY(int,what0,what0_int)
+}
+
+int main()
+{
+ int a = 99;
+ using boost::phoenix::arg_names::arg1;
+ BOOST_TEST(example::what_int(a) == a);
+ BOOST_TEST(example::what(a)() == a);
+ BOOST_TEST(example::what(arg1)(a) == a);
+ BOOST_TEST(example::what0_int() == 100);
+ BOOST_TEST(example::what0()() == 100);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/function/lazy_thunk_tests.cpp b/src/boost/libs/phoenix/test/function/lazy_thunk_tests.cpp
new file mode 100644
index 000000000..f44e991e5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/function/lazy_thunk_tests.cpp
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////
+//
+// lazy_thunk_tests.cpp
+//
+// Tests for thunk functions.
+//
+//
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#include <iostream>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/phoenix/function/lazy_prelude.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+
+using namespace boost::phoenix;
+
+using std::cout;
+using std::endl;
+
+
+
+int main() {
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+
+ BOOST_TEST( thunk1(inc,1)()() == 2);
+ BOOST_TEST( thunk1(inc,arg1)(1)() == 2);
+ BOOST_TEST( thunk2(plus,1,2)()() == 3);
+ BOOST_TEST( thunk2(plus,arg1,arg2)(1,2)() == 3);
+
+ list<int> l = enum_from_to(1,5);
+ list<int> l4 = take(4,l)();
+ BOOST_TEST( foldl(plus,0,l4)() == 10);
+ BOOST_TEST( thunk3(foldl,plus,0,l4)()() == 10);
+ BOOST_TEST( thunk3(foldl,plus,arg1,l4)(0)() == 10);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/include/bind.cpp b/src/boost/libs/phoenix/test/include/bind.cpp
new file mode 100644
index 000000000..a49d63818
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/bind.cpp
@@ -0,0 +1,9 @@
+/*=============================================================================
+ Copyright (c) 2011 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/bind.hpp>
+
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/bind/bind_member_function.cpp b/src/boost/libs/phoenix/test/include/bind/bind_member_function.cpp
new file mode 100644
index 000000000..702854cbd
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/bind/bind_member_function.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/bind/bind_member_function.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/bind/bind_member_variable.cpp b/src/boost/libs/phoenix/test/include/bind/bind_member_variable.cpp
new file mode 100644
index 000000000..48af810ab
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/bind/bind_member_variable.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/bind/bind_member_variable.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core.cpp b/src/boost/libs/phoenix/test/include/core.cpp
new file mode 100644
index 000000000..cb7d797d5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+//#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/core.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/actor.cpp b/src/boost/libs/phoenix/test/include/core/actor.cpp
new file mode 100644
index 000000000..45cb896b5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/actor.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/actor.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/argument.cpp b/src/boost/libs/phoenix/test/include/core/argument.cpp
new file mode 100644
index 000000000..7ea062c5d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/argument.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/argument.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/arity.cpp b/src/boost/libs/phoenix/test/include/core/arity.cpp
new file mode 100644
index 000000000..c4eb2a529
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/arity.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/arity.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/bug7730.cpp b/src/boost/libs/phoenix/test/include/core/bug7730.cpp
new file mode 100644
index 000000000..1baae29e3
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/bug7730.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/call.cpp b/src/boost/libs/phoenix/test/include/core/call.cpp
new file mode 100644
index 000000000..82d19273c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/call.cpp
@@ -0,0 +1,12 @@
+/*==============================================================================
+ 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/call.hpp>
+
+int main() {}
+
diff --git a/src/boost/libs/phoenix/test/include/core/debug.cpp b/src/boost/libs/phoenix/test/include/core/debug.cpp
new file mode 100644
index 000000000..fb2ec658d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/debug.cpp
@@ -0,0 +1,13 @@
+/*==============================================================================
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+ Copyright (c) 2024 John Fletcher
+
+ 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/debug.hpp>
+
+int main() {}
+
diff --git a/src/boost/libs/phoenix/test/include/core/domain.cpp b/src/boost/libs/phoenix/test/include/core/domain.cpp
new file mode 100644
index 000000000..3d356c7b7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/domain.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/domain.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/environment.cpp b/src/boost/libs/phoenix/test/include/core/environment.cpp
new file mode 100644
index 000000000..48fab1088
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/environment.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/environment.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/expression.cpp b/src/boost/libs/phoenix/test/include/core/expression.cpp
new file mode 100644
index 000000000..ac83c4bfd
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/expression.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/expression.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/function_equal.cpp b/src/boost/libs/phoenix/test/include/core/function_equal.cpp
new file mode 100644
index 000000000..b66e9d302
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/function_equal.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/function_equal.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/is_actor.cpp b/src/boost/libs/phoenix/test/include/core/is_actor.cpp
new file mode 100644
index 000000000..8a8625222
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/is_actor.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/is_actor.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/is_nullary.cpp b/src/boost/libs/phoenix/test/include/core/is_nullary.cpp
new file mode 100644
index 000000000..c9f4e9b09
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/is_nullary.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/is_nullary.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/limits.cpp b/src/boost/libs/phoenix/test/include/core/limits.cpp
new file mode 100644
index 000000000..726c70e7e
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/limits.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/limits.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/meta_grammar.cpp b/src/boost/libs/phoenix/test/include/core/meta_grammar.cpp
new file mode 100644
index 000000000..9f3494d3d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/meta_grammar.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/meta_grammar.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/nothing.cpp b/src/boost/libs/phoenix/test/include/core/nothing.cpp
new file mode 100644
index 000000000..b905a9c4c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/nothing.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+//#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/core/nothing.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/reference.cpp b/src/boost/libs/phoenix/test/include/core/reference.cpp
new file mode 100644
index 000000000..d8a886192
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/reference.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/reference.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/terminal.cpp b/src/boost/libs/phoenix/test/include/core/terminal.cpp
new file mode 100644
index 000000000..5c7104033
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/terminal.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/terminal.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/core/value.cpp b/src/boost/libs/phoenix/test/include/core/value.cpp
new file mode 100644
index 000000000..73318c4fd
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/core/value.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/value.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/function.cpp b/src/boost/libs/phoenix/test/include/function.cpp
new file mode 100644
index 000000000..4cc7acadd
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/function.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/function.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/function/function.cpp b/src/boost/libs/phoenix/test/include/function/function.cpp
new file mode 100644
index 000000000..48b205558
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/function/function.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/function/function.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/function/lazy_headers.cpp b/src/boost/libs/phoenix/test/include/function/lazy_headers.cpp
new file mode 100644
index 000000000..8015d18b6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/function/lazy_headers.cpp
@@ -0,0 +1,10 @@
+/*=============================================================================
+ Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2011 Thomas Heller
+ Copyright (c) 2015 John Fletcher
+ 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/function/lazy_prelude.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/fusion.cpp b/src/boost/libs/phoenix/test/include/fusion.cpp
new file mode 100644
index 000000000..f55ec0287
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/fusion.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/fusion.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/fusion/at.cpp b/src/boost/libs/phoenix/test/include/fusion/at.cpp
new file mode 100644
index 000000000..acec69d07
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/fusion/at.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/fusion/at.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/fusion_at.cpp b/src/boost/libs/phoenix/test/include/fusion_at.cpp
new file mode 100644
index 000000000..b35d30855
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/fusion_at.cpp
@@ -0,0 +1,11 @@
+/*=============================================================================
+ 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)
+==============================================================================*/
+
+//Check if files are includable without errors
+#include <boost/phoenix/fusion/at.hpp>
+
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object.cpp b/src/boost/libs/phoenix/test/include/object.cpp
new file mode 100644
index 000000000..19b20ba43
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/const_cast.cpp b/src/boost/libs/phoenix/test/include/object/const_cast.cpp
new file mode 100644
index 000000000..d440e9441
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/const_cast.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/const_cast.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/construct.cpp b/src/boost/libs/phoenix/test/include/object/construct.cpp
new file mode 100644
index 000000000..e5d386a0b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/construct.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/construct.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/delete.cpp b/src/boost/libs/phoenix/test/include/object/delete.cpp
new file mode 100644
index 000000000..fdd297c99
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/delete.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/delete.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/dynamic_cast.cpp b/src/boost/libs/phoenix/test/include/object/dynamic_cast.cpp
new file mode 100644
index 000000000..3f8b9dab8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/dynamic_cast.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/dynamic_cast.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/new.cpp b/src/boost/libs/phoenix/test/include/object/new.cpp
new file mode 100644
index 000000000..482545834
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/new.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/new.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/reinterpret_cast.cpp b/src/boost/libs/phoenix/test/include/object/reinterpret_cast.cpp
new file mode 100644
index 000000000..d21112d0e
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/reinterpret_cast.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/reinterpret_cast.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/object/static_cast.cpp b/src/boost/libs/phoenix/test/include/object/static_cast.cpp
new file mode 100644
index 000000000..ae9e834f2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/object/static_cast.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/object/static_cast.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator.cpp b/src/boost/libs/phoenix/test/include/operator.cpp
new file mode 100644
index 000000000..b7aa27ea7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/arithmetic.cpp b/src/boost/libs/phoenix/test/include/operator/arithmetic.cpp
new file mode 100644
index 000000000..214600f02
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/arithmetic.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/arithmetic.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/bitwise.cpp b/src/boost/libs/phoenix/test/include/operator/bitwise.cpp
new file mode 100644
index 000000000..4caa3ca31
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/bitwise.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/bitwise.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/comparison.cpp b/src/boost/libs/phoenix/test/include/operator/comparison.cpp
new file mode 100644
index 000000000..49912bd9f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/comparison.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/comparison.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/if_else.cpp b/src/boost/libs/phoenix/test/include/operator/if_else.cpp
new file mode 100644
index 000000000..2ff9fc4f6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/if_else.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/if_else.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/io.cpp b/src/boost/libs/phoenix/test/include/operator/io.cpp
new file mode 100644
index 000000000..72069f0f1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/io.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/io.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/logical.cpp b/src/boost/libs/phoenix/test/include/operator/logical.cpp
new file mode 100644
index 000000000..35740be7f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/logical.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/logical.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/member.cpp b/src/boost/libs/phoenix/test/include/operator/member.cpp
new file mode 100644
index 000000000..6d3c2091a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/member.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/member.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/operator/self.cpp b/src/boost/libs/phoenix/test/include/operator/self.cpp
new file mode 100644
index 000000000..204509f70
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/operator/self.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/operator/self.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/phoenix.cpp b/src/boost/libs/phoenix/test/include/phoenix.cpp
new file mode 100644
index 000000000..f54aede0c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/phoenix.cpp
@@ -0,0 +1,12 @@
+/*==============================================================================
+ 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/phoenix.hpp>
+
+int main()
+{}
diff --git a/src/boost/libs/phoenix/test/include/scope.cpp b/src/boost/libs/phoenix/test/include/scope.cpp
new file mode 100644
index 000000000..dfd47d60b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/scope.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/scope/dynamic.cpp b/src/boost/libs/phoenix/test/include/scope/dynamic.cpp
new file mode 100644
index 000000000..e3eb1804a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope/dynamic.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/scope/dynamic.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/scope/lambda.cpp b/src/boost/libs/phoenix/test/include/scope/lambda.cpp
new file mode 100644
index 000000000..aa08f7582
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope/lambda.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/scope/lambda.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/scope/let.cpp b/src/boost/libs/phoenix/test/include/scope/let.cpp
new file mode 100644
index 000000000..d0f6d11a9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope/let.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/scope/let.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/scope/local_variable.cpp b/src/boost/libs/phoenix/test/include/scope/local_variable.cpp
new file mode 100644
index 000000000..718f748d2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope/local_variable.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/scope/local_variable.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/scope/scoped_environment.cpp b/src/boost/libs/phoenix/test/include/scope/scoped_environment.cpp
new file mode 100644
index 000000000..56c1c0e7f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope/scoped_environment.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/scope/scoped_environment.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/scope/this.cpp b/src/boost/libs/phoenix/test/include/scope/this.cpp
new file mode 100644
index 000000000..95b550c22
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/scope/this.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/scope/this.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/spirit.cpp b/src/boost/libs/phoenix/test/include/spirit.cpp
new file mode 100644
index 000000000..cea7d521e
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/spirit.cpp
@@ -0,0 +1,10 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+ 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)
+==============================================================================*/
+// Cross check that I have not broken spirit
+#include <boost/spirit/home/karma.hpp>
+#include <boost/spirit/home/lex.hpp>
+#include <boost/spirit/home/qi.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/spirit_no_specialize.cpp b/src/boost/libs/phoenix/test/include/spirit_no_specialize.cpp
new file mode 100644
index 000000000..2ab7a58b1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/spirit_no_specialize.cpp
@@ -0,0 +1,11 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+ 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)
+==============================================================================*/
+// Cross check that I have not broken spirit
+#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/spirit/home/karma.hpp>
+#include <boost/spirit/home/lex.hpp>
+#include <boost/spirit/home/qi.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement.cpp b/src/boost/libs/phoenix/test/include/statement.cpp
new file mode 100644
index 000000000..eb2d093b3
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+//#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/statement.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/do_while.cpp b/src/boost/libs/phoenix/test/include/statement/do_while.cpp
new file mode 100644
index 000000000..9f4aadbe0
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/do_while.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/do_while.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/for.cpp b/src/boost/libs/phoenix/test/include/statement/for.cpp
new file mode 100644
index 000000000..a3d513e95
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/for.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/for.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/if.cpp b/src/boost/libs/phoenix/test/include/statement/if.cpp
new file mode 100644
index 000000000..3fae4b74a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/if.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/if.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/sequence.cpp b/src/boost/libs/phoenix/test/include/statement/sequence.cpp
new file mode 100644
index 000000000..56f49122b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/sequence.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/sequence.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/switch.cpp b/src/boost/libs/phoenix/test/include/statement/switch.cpp
new file mode 100644
index 000000000..e92184101
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/switch.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/switch.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/throw.cpp b/src/boost/libs/phoenix/test/include/statement/throw.cpp
new file mode 100644
index 000000000..5c506fedc
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/throw.cpp
@@ -0,0 +1,8 @@
+/*=============================================================================
+ Copyright (c) 2011 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)
+==============================================================================*/
+//#define BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
+#include <boost/phoenix/statement/throw.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/try_catch.cpp b/src/boost/libs/phoenix/test/include/statement/try_catch.cpp
new file mode 100644
index 000000000..f743aeb5e
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/try_catch.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/try_catch.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/statement/while.cpp b/src/boost/libs/phoenix/test/include/statement/while.cpp
new file mode 100644
index 000000000..a99e9d22f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/statement/while.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement/while.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl.cpp b/src/boost/libs/phoenix/test/include/stl.cpp
new file mode 100644
index 000000000..9b936d7ed
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl/algorithm.cpp b/src/boost/libs/phoenix/test/include/stl/algorithm.cpp
new file mode 100644
index 000000000..9f5da047b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl/algorithm.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl/algorithm.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl/algorithm/iteration.cpp b/src/boost/libs/phoenix/test/include/stl/algorithm/iteration.cpp
new file mode 100644
index 000000000..67828987f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl/algorithm/iteration.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl/algorithm/iteration.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl/algorithm/querying.cpp b/src/boost/libs/phoenix/test/include/stl/algorithm/querying.cpp
new file mode 100644
index 000000000..892cf92ea
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl/algorithm/querying.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl/algorithm/querying.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl/algorithm/transformation.cpp b/src/boost/libs/phoenix/test/include/stl/algorithm/transformation.cpp
new file mode 100644
index 000000000..9ac506997
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl/algorithm/transformation.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl/algorithm/transformation.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl/container.cpp b/src/boost/libs/phoenix/test/include/stl/container.cpp
new file mode 100644
index 000000000..4a985a9ce
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl/container.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl/container.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/stl/container/container.cpp b/src/boost/libs/phoenix/test/include/stl/container/container.cpp
new file mode 100644
index 000000000..403547fd1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/stl/container/container.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/stl/container/container.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/support/iterate.cpp b/src/boost/libs/phoenix/test/include/support/iterate.cpp
new file mode 100644
index 000000000..1c2781ad1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/support/iterate.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/support/iterate.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/support/preprocessor/round.cpp b/src/boost/libs/phoenix/test/include/support/preprocessor/round.cpp
new file mode 100644
index 000000000..bc81c7954
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/support/preprocessor/round.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/support/preprocessor/round.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/include/version.cpp b/src/boost/libs/phoenix/test/include/version.cpp
new file mode 100644
index 000000000..e42703e30
--- /dev/null
+++ b/src/boost/libs/phoenix/test/include/version.cpp
@@ -0,0 +1,7 @@
+/*=============================================================================
+ Copyright (c) 2011 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/version.hpp>
+int main() {}
diff --git a/src/boost/libs/phoenix/test/object/cast_tests.cpp b/src/boost/libs/phoenix/test/object/cast_tests.cpp
new file mode 100644
index 000000000..11745269c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/object/cast_tests.cpp
@@ -0,0 +1,67 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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 <string>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/object.hpp>
+
+using std::string;
+
+struct T
+{
+ string foo() { return "T"; }
+};
+
+struct U : T
+{
+ string foo() { return "U"; }
+};
+
+struct VT
+{
+ virtual string foo() { return "T"; }
+};
+
+struct VU : VT
+{
+ virtual string foo() { return "U"; }
+};
+
+int
+main()
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::const_cast_;
+ using boost::phoenix::dynamic_cast_;
+ using boost::phoenix::reinterpret_cast_;
+ using boost::phoenix::static_cast_;
+
+ {
+ U u;
+ BOOST_TEST(arg1(u).foo() == "U");
+ BOOST_TEST(static_cast_<T&>(arg1)(u).foo() == "T");
+ }
+
+ {
+ U const u = U();
+ BOOST_TEST(const_cast_<U&>(arg1)(u).foo() == "U");
+ }
+
+ {
+ VU u;
+ VT* tp = &u;
+ BOOST_TEST(arg1(tp)->foo() == "U");
+ BOOST_TEST(dynamic_cast_<VU*>(arg1)(tp) != 0);
+ }
+
+ {
+ void* p = 0;
+ reinterpret_cast_<VU*>(arg1)(p); // compile test only
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/object/new_delete_tests.cpp b/src/boost/libs/phoenix/test/object/new_delete_tests.cpp
new file mode 100644
index 000000000..a84168f42
--- /dev/null
+++ b/src/boost/libs/phoenix/test/object/new_delete_tests.cpp
@@ -0,0 +1,59 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <boost/shared_ptr.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/object.hpp>
+#include <boost/phoenix/operator.hpp>
+
+int n = 0;
+
+using std::cout;
+using std::endl;
+
+struct X
+{
+ X(int, int, int) { cout << "new X(int, int, int)" << endl; ++n; }
+ X() { cout << "new X" << endl; ++n; }
+ ~X() { cout << "delete X" << endl; --n; }
+};
+
+int
+main()
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::construct;
+ using boost::phoenix::delete_;
+ using boost::phoenix::new_;
+
+ using std::for_each;
+ using std::vector;
+
+ {
+ vector<X*> v(10);
+
+ for_each(v.begin(), v.end(), arg1 = new_<X>());
+ for_each(v.begin(), v.end(), delete_(arg1));
+
+ for_each(v.begin(), v.end(), arg1 = new_<X>(1, 2, 3));
+ for_each(v.begin(), v.end(), delete_(arg1));
+ }
+
+ {
+ using boost::shared_ptr;
+ vector<shared_ptr<X> > v(10);
+ for_each(v.begin(), v.end(),
+ arg1 = boost::phoenix::construct<shared_ptr<X> >(new_<X>())
+ );
+ }
+
+ BOOST_TEST(n == 0);
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/arithmetic_tests.cpp b/src/boost/libs/phoenix/test/operator/arithmetic_tests.cpp
new file mode 100644
index 000000000..7087e3dda
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/arithmetic_tests.cpp
@@ -0,0 +1,71 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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/core/lightweight_test.hpp>
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+#include <boost/bind.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::ref;
+ using phoenix::val;
+
+ {
+ int x = 123;
+
+ BOOST_TEST((ref(x) += 456)() == (123 + 456));
+ BOOST_TEST(x == 123 + 456);
+ BOOST_TEST((ref(x) -= 456)() == 123);
+ BOOST_TEST(x == 123);
+ BOOST_TEST((ref(x) *= 456)() == 123 * 456);
+ BOOST_TEST(x == 123 * 456);
+ BOOST_TEST((ref(x) /= 456)() == 123);
+ BOOST_TEST(x == 123);
+
+ int& r1 = (ref(x) += 456)(); // should be an lvalue
+ int& r2 = (ref(x) -= 456)(); // should be an lvalue
+ int& r3 = (ref(x) *= 456)(); // should be an lvalue
+ int& r4 = (ref(x) /= 456)(); // should be an lvalue
+ BOOST_TEST(r1 == 123 && r2 == 123 && r3 == 123 && r4 == 123);
+
+ BOOST_TEST((ref(x) %= 456)() == 123 % 456);
+ BOOST_TEST(x == 123 % 456);
+ }
+
+ {
+ BOOST_TEST((-val(123))() == -123);
+ BOOST_TEST((val(123) + 456)() == 123 + 456);
+ BOOST_TEST((val(123) - 456)() == 123 - 456);
+ BOOST_TEST((val(123) * 456)() == 123 * 456);
+ BOOST_TEST((val(123) / 456)() == 123 / 456);
+ BOOST_TEST((val(123) % 456)() == 123 % 456);
+
+ BOOST_TEST((123 + val(456))() == 123 + 456);
+ BOOST_TEST((123 - val(456))() == 123 - 456);
+ BOOST_TEST((123 * val(456))() == 123 * 456);
+ BOOST_TEST((123 / val(456))() == 123 / 456);
+ BOOST_TEST((123 % val(456))() == 123 % 456);
+ }
+ {
+ // Testcase contributed from Philipp Reh, failed in Phoenix V2
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::arg_names::arg2;
+
+ int x[2];
+
+ BOOST_TEST((&arg1 - &arg2)(x[0], x[1]) == &x[0] - &x[1]);
+ BOOST_TEST((arg1 - arg2)(&x[0], &x[1]) == &x[0] - &x[1]);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/bitwise_tests.cpp b/src/boost/libs/phoenix/test/operator/bitwise_tests.cpp
new file mode 100644
index 000000000..094bde682
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/bitwise_tests.cpp
@@ -0,0 +1,76 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::ref;
+ using phoenix::val;
+ using phoenix::arg_names::arg1;
+ using std::cout;
+
+ {
+ int x;
+ int y;
+
+ x = 123;
+ y = 123;
+ (ref(x) &= 456)();
+ y &= 456;
+ BOOST_TEST(x == y);
+
+ x = 123;
+ y = 123;
+ (ref(x) |= 456)();
+ y |= 456;
+ BOOST_TEST(x == y);
+
+ x = 123;
+ y = 123;
+ (ref(x) ^= 456)();
+ y ^= 456;
+ BOOST_TEST(x == y);
+
+ x = 123;
+ y = 123;
+ (ref(x) <<= 4)();
+ y <<= 4;
+ BOOST_TEST(x == y);
+
+ x = 1230000;
+ y = 1230000;
+ (ref(x) >>= 4)();
+ y >>= 4;
+ BOOST_TEST(x == y);
+
+ int& r1 = (ref(x) &= 456)(); // should be an lvalue
+ int& r2 = (ref(x) |= 456)(); // should be an lvalue
+ int& r3 = (ref(x) ^= 456)(); // should be an lvalue
+ int& r4 = (ref(x) <<= 4)(); // should be an lvalue
+ int& r5 = (ref(x) >>= 4)(); // should be an lvalue
+ BOOST_TEST(&r1 == &r2 && &r2 == &r3 && &r3 == &r4 && &r4 == &r5);
+ }
+
+ {
+ BOOST_TEST((val(123) & 456)() == (123 & 456));
+ BOOST_TEST((val(123) | 456)() == (123 | 456));
+ BOOST_TEST((val(123) ^ 456)() == (123 ^ 456));
+ BOOST_TEST((val(123) << 4)() == (123 << 4));
+ BOOST_TEST((val(1230000) >> 4)() == (1230000 >> 4));
+
+ char const* s = "Yabadabadoo!!!\n";
+ (cout << arg1)(s);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/comparison_tests.cpp b/src/boost/libs/phoenix/test/operator/comparison_tests.cpp
new file mode 100644
index 000000000..cc799342c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/comparison_tests.cpp
@@ -0,0 +1,29 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::val;
+
+ {
+ BOOST_TEST(!(val(123) == 456)());
+ BOOST_TEST((val(123) != 456)());
+ BOOST_TEST(!(val(123) > 456)());
+ BOOST_TEST((val(123) < 456)());
+ BOOST_TEST(!(val(123) > 456)());
+ BOOST_TEST((val(123) <= 123)());
+ BOOST_TEST((val(123) >= 123)());
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/if_else_tests.cpp b/src/boost/libs/phoenix/test/operator/if_else_tests.cpp
new file mode 100644
index 000000000..f4d49f087
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/if_else_tests.cpp
@@ -0,0 +1,36 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ //using phoenix::if_else;
+ using phoenix::ref;
+ using phoenix::val;
+ using phoenix::arg_names::arg1;
+ {
+ int x = 0;
+ int y = 0;
+ bool c = false;
+
+ BOOST_TEST(phoenix::if_else(arg1, 1234, 5678)(c) == 5678);
+ BOOST_TEST(phoenix::if_else(arg1, 1234, 'x')(c) == 'x');
+
+ int& r = phoenix::if_else(arg1, ref(x), ref(y))(c); // should be an lvalue
+ BOOST_TEST(&y == &r);
+
+ (phoenix::if_else(arg1, ref(x), ref(y)) = 986754321)(c);
+ BOOST_TEST(y == 986754321);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/io_tests.cpp b/src/boost/libs/phoenix/test/operator/io_tests.cpp
new file mode 100644
index 000000000..de4f1ea55
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/io_tests.cpp
@@ -0,0 +1,61 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <sstream>
+#include <string>
+#include <algorithm>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::val;
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+ using std::cout;
+ using std::endl;
+ using std::hex;
+ using std::for_each;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
+ int i100 = 100;
+ string hello = "hello";
+ const char* world = " world";
+
+ int init[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ vector<int> v(init, init+10);
+
+ char const* msg = "cout assert\n";
+ (cout << arg1)(msg);
+ (cout << arg1 << endl)(hello);
+ (arg1 << hex)(cout);
+ (cout << val(hello))();
+
+ (cout << val(hello) << world << ", you da man!\n")();
+ for_each(v.begin(), v.end(), cout << arg1 << ',');
+ (cout << arg1 + 1)(i100);
+
+ (cout << arg1 << "this is it, shukz:" << hex << arg2 << endl << endl)(msg, i100);
+
+ int in;
+ int out = 12345;
+ stringstream sstr;
+ (sstr << arg1)(out);
+ (sstr >> arg1)(in);
+ BOOST_TEST(in == out);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/logical_tests.cpp b/src/boost/libs/phoenix/test/operator/logical_tests.cpp
new file mode 100644
index 000000000..383db48f7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/logical_tests.cpp
@@ -0,0 +1,36 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+ {
+ bool x = false;
+ bool y = true;
+
+ BOOST_TEST((!arg1)(x) == true);
+ BOOST_TEST((!arg1)(y) == false);
+ BOOST_TEST((arg1 || arg2)(x, y) == true);
+ BOOST_TEST((arg1 && arg2)(x, y) == false);
+
+ // short circuiting:
+ int i = 1234;
+ (arg1 || (arg2 = 4567))(y, i);
+ BOOST_TEST(i == 1234);
+ (arg1 && (arg2 = 4567))(y, i);
+ BOOST_TEST(i == 4567);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/member.cpp b/src/boost/libs/phoenix/test/operator/member.cpp
new file mode 100644
index 000000000..1abd22d3a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/member.cpp
@@ -0,0 +1,108 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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/operator.hpp>
+#include <boost/detail/lightweight_test.hpp>
+//#include <boost/move/unique_ptr.hpp>
+
+#include <memory>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
+namespace
+{
+ struct Test
+ {
+ int value;
+
+ int func(int n) const { return n; }
+ int dunc() { return 10; }
+ int kunc() const { return 555; }
+ };
+}
+
+namespace phoenix = boost::phoenix;
+
+int main()
+{
+ using boost::scoped_ptr;
+ using boost::shared_ptr;
+ using phoenix::val;
+ using phoenix::ref;
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+
+ Test test = {1};
+ const Test* cptr = &test;
+ Test* ptr = &test;
+
+ BOOST_TEST((val(ptr)->*&Test::value)() == 1);
+ BOOST_TEST((val(cptr)->*&Test::value)() == 1);
+ BOOST_TEST((arg1->*&Test::value)(cptr) == 1);
+
+ ((val(ptr)->*&Test::value) = 2)();
+ BOOST_TEST(test.value == 2);
+
+
+ BOOST_TEST((val(ptr)->*&Test::func)(val(3))() == 3);
+ int i = 33;
+ BOOST_TEST((arg1->*&Test::func)(arg2)(cptr, i) == i);
+ //BOOST_TEST((val(cptr)->*&Test::func)(4)() == 4);
+ BOOST_TEST((val(ptr)->*&Test::dunc)()() == 10);
+
+ BOOST_TEST((arg1->*&Test::func)(5)(ptr) == 5);
+ BOOST_TEST((arg1->*&Test::kunc)()(ptr));
+
+ shared_ptr<Test> sptr(new Test(test));
+
+ BOOST_TEST((arg1->*&Test::value)(sptr) == 2);
+ BOOST_TEST((arg1->*&Test::func)(6)(sptr) == 6);
+
+ scoped_ptr<Test> scptr(new Test(test));
+
+ BOOST_TEST((arg1->*&Test::value)(scptr) == 2);
+ BOOST_TEST((arg1->*&Test::func)(7)(scptr) == 7);
+
+ shared_ptr<const Test> csptr(new Test(test));
+
+ BOOST_TEST((arg1->*&Test::value)(csptr) == 2);
+ BOOST_TEST((arg1->*&Test::func)(8)(csptr) == 8);
+
+ scoped_ptr<const Test> cscptr(new Test(test));
+
+ BOOST_TEST((arg1->*&Test::value)(cscptr) == 2);
+ BOOST_TEST((arg1->*&Test::func)(9)(cscptr) == 9);
+
+#ifdef BOOST_NO_CXX11_SMART_PTR
+ std::auto_ptr<Test> aptr(new Test(test));
+#else
+ std::unique_ptr<Test> aptr(new Test(test));
+#endif
+
+ BOOST_TEST((arg1->*&Test::value)(aptr) == 2);
+ BOOST_TEST((arg1->*&Test::func)(10)(aptr) == 10);
+
+#ifdef BOOST_NO_CXX11_SMART_PTR
+ std::auto_ptr<const Test> captr(new Test(test));
+#else
+ std::unique_ptr<const Test> captr(new Test(test));
+#endif
+
+ BOOST_TEST((arg1->*&Test::value)(captr) == 2);
+ BOOST_TEST((arg1->*&Test::func)(11)(captr) == 11);
+
+ //boost::movelib::unique_ptr<Test> buptr(new Test(test));
+ //BOOST_TEST((arg1->*&Test::value)(buptr) == 2);
+ //BOOST_TEST((arg1->*&Test::func)(12)(buptr) == 12);
+
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/misc_binary_tests.cpp b/src/boost/libs/phoenix/test/operator/misc_binary_tests.cpp
new file mode 100644
index 000000000..468fed243
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/misc_binary_tests.cpp
@@ -0,0 +1,104 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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 <string>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::ref;
+ using phoenix::val;
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+ using std::string;
+ { // From Phoenix 1.1 binary tests
+
+ int i2 = 2, i3 = 3, i = 5;
+ const char* world = " world";
+
+
+#if !(defined(BOOST_MSVC) && (BOOST_MSVC >= 1900))
+ BOOST_TEST((ref(i) = ref(i))() == 5);
+#endif
+ BOOST_TEST((ref(i) = 3)() == 3);
+ BOOST_TEST(i == 3);
+ i = 5;
+ int x, y, z;
+ (ref(x) = ref(y) = ref(z) = 10)();
+ BOOST_TEST(x == 10 && y == 10 && z == 10);
+ BOOST_TEST((val(world)[3])() == world[3]);
+
+ BOOST_TEST((ref(i) += 5)() == 10);
+ BOOST_TEST((ref(i) -= 5)() == 5);
+ BOOST_TEST((ref(i) *= 5)() == 25);
+ BOOST_TEST((ref(i) /= 5)() == 5);
+ BOOST_TEST((ref(i) %= 2)() == 1);
+
+ BOOST_TEST((ref(i) <<= 3)() == 8);
+ BOOST_TEST((ref(i) >>= 1)() == 4);
+ BOOST_TEST((ref(i) |= 0xFF)() == 0xFF);
+ BOOST_TEST((ref(i) &= 0xF0)() == 0xF0);
+ BOOST_TEST((ref(i) ^= 0xFFFFFFFF)() == int(0xFFFFFF0F));
+
+ BOOST_TEST((val(5) == val(5))());
+ BOOST_TEST((val(5) == 5)());
+
+ BOOST_TEST((arg1 + arg2 )(i2, i3) == i2 + i3 );
+ BOOST_TEST((arg1 - arg2)(i2, i3) == i2 - i3);
+ BOOST_TEST((arg1 * arg2)(i2, i3) == i2 * i3);
+ BOOST_TEST((arg1 / arg2)(i2, i3) == i2 / i3);
+ BOOST_TEST((arg1 % arg2)(i2, i3) == i2 % i3);
+ BOOST_TEST((arg1 & arg2)(i2, i3) == (i2 & i3));
+ BOOST_TEST((arg1 | arg2)(i2, i3) == (i2 | i3));
+ BOOST_TEST((arg1 ^ arg2)(i2, i3) == (i2 ^ i3));
+ BOOST_TEST((arg1 << arg2)(i2, i3) == i2 << i3);
+ BOOST_TEST((arg1 >> arg2)(i2, i3) == i2 >> i3);
+
+ BOOST_TEST((val(5) != val(6))());
+ BOOST_TEST((val(5) < val(6))());
+ BOOST_TEST(!(val(5) > val(6))());
+ BOOST_TEST((val(5) < val(6))());
+ BOOST_TEST((val(5) <= val(6))());
+ BOOST_TEST((val(5) <= val(5))());
+ BOOST_TEST((val(7) >= val(6))());
+ BOOST_TEST((val(7) >= val(7))());
+
+ BOOST_TEST((val(false) && val(false))() == false);
+ BOOST_TEST((val(true) && val(false))() == false);
+ BOOST_TEST((val(false) && val(true))() == false);
+ BOOST_TEST((val(true) && val(true))() == true);
+
+ BOOST_TEST((val(false) || val(false))() == false);
+ BOOST_TEST((val(true) || val(false))() == true);
+ BOOST_TEST((val(false) || val(true))() == true);
+ BOOST_TEST((val(true) || val(true))() == true);
+ }
+
+ { // From Phoenix 1.1 mixed_binary tests
+
+ int i1 = 1, i2 = 2, i50 = 50, i100 = 100;
+ double d2_5 = 2.5;
+ string hello = "hello";
+ const char* world = " world";
+
+ BOOST_TEST((arg1 + arg2)(i100, i50) == (i100 + i50));
+ BOOST_TEST((arg1 + 3)(i100) == (3 + i100));
+ BOOST_TEST((arg1 + arg2)(hello, world) == "hello world");
+ BOOST_TEST((arg1 + arg2)(i1, d2_5) == (i1 + d2_5));
+
+ BOOST_TEST((*(arg1 + arg2))(world, i2) == *(world + i2));
+ BOOST_TEST((*(arg1 + arg2))(i2, world) == *(i2 + world));
+ BOOST_TEST((*(val(world+i2) - arg1))(i2) == *world);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/self_tests.cpp b/src/boost/libs/phoenix/test/operator/self_tests.cpp
new file mode 100644
index 000000000..595ef6922
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/self_tests.cpp
@@ -0,0 +1,60 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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 <vector>
+#include <string>
+#include <map>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::ref;
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+ using std::map;
+ using std::string;
+ using std::vector;
+
+ {
+ int x = 123;
+ BOOST_TEST((&arg1)(x) == &x);
+ //BOOST_TEST((*&arg1)(x) == 123);
+
+ int y = 968;
+ (ref(x) = arg1)(y);
+ BOOST_TEST(x == y);
+
+ (arg1 = 456)(x);
+ BOOST_TEST(x == 456);
+ int& r = (arg1 = 456)(x); // must be an lvalue
+ BOOST_TEST(&r == &x);
+
+ int c[] = { 1, 2, 3, 4, 5 };
+ BOOST_TEST((arg1[3])(c) == 4);
+
+ int& r2 = (arg1[3])(c); // must be an lvalue
+ BOOST_TEST(&r2 == &c[3]);
+
+ vector<string> v;
+ v.push_back("a");
+ v.push_back("b");
+ v.push_back("c");
+ v.push_back("d");
+
+ BOOST_TEST((arg1[3])(v) == "d");
+
+ map<string, int> m;
+ (arg1["Kimpo"] = arg2)(m, x);
+ BOOST_TEST(m["Kimpo"] == x);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/operator/unary_tests.cpp b/src/boost/libs/phoenix/test/operator/unary_tests.cpp
new file mode 100644
index 000000000..a5636e496
--- /dev/null
+++ b/src/boost/libs/phoenix/test/operator/unary_tests.cpp
@@ -0,0 +1,65 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+namespace phoenix = boost::phoenix;
+
+int
+main()
+{
+ using phoenix::val;
+ using phoenix::ref;
+ using phoenix::arg_names::arg1;
+ {
+ BOOST_TEST((-val(123))() == -123);
+ BOOST_TEST((- -val(123))() == 123);
+ BOOST_TEST((+val(123))() == 123);
+ }
+
+ {
+ int x = 123;
+
+ BOOST_TEST((++ref(x))() == 124);
+ BOOST_TEST(x == 124);
+ BOOST_TEST((--ref(x))() == 123);
+ BOOST_TEST(x == 123);
+
+ BOOST_TEST((ref(x)++)() == 123);
+ BOOST_TEST(x == 124);
+ BOOST_TEST((ref(x)--)() == 124);
+ BOOST_TEST(x == 123);
+
+ int& r1 = (++ref(x))(); // should be an lvalue
+ int& r2 = (--ref(x))(); // should be an lvalue
+ BOOST_TEST(r1 == 123 && r2 == 123);
+ }
+
+ { // From Phoenix 1.1 unary tests
+
+ int i1 = 1, i = 5;
+
+ BOOST_TEST((!val(true))() == false);
+ BOOST_TEST((-val(1))() == -1);
+ BOOST_TEST((+val(1))() == +1);
+ BOOST_TEST((~val(1))() == ~1);
+ BOOST_TEST(*(&arg1)(i1) == *(&i1));
+ BOOST_TEST((&arg1)(i1) == &i1);
+
+ BOOST_TEST((*val(&i1))() == *(&i1));
+ BOOST_TEST((*&arg1)(i1) == *(&i1));
+ BOOST_TEST((++ref(i))() == 6);
+ BOOST_TEST((--ref(i))() == 5);
+ BOOST_TEST((ref(i)++)() == 5);
+ BOOST_TEST(i == 6);
+ BOOST_TEST((ref(i)--)() == 6);
+ BOOST_TEST(i == 5);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/regression/actor_assignment.cpp b/src/boost/libs/phoenix/test/regression/actor_assignment.cpp
new file mode 100644
index 000000000..9c0259c06
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/actor_assignment.cpp
@@ -0,0 +1,29 @@
+/*=============================================================================
+ Copyright (c) 2018 Nikita Kniazev
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix.hpp>
+#include <boost/function.hpp>
+#include <string>
+
+// Checks that rhs Phoenix actor is taken by value on assignment.
+// The wrapper function is used to ensure that created temporaries are
+// out of scope (as they will be created on the other stack frame).
+
+boost::function<void()> make_assignment_test(std::string & s)
+{
+ return boost::phoenix::ref(s) = "asd";
+}
+
+int main()
+{
+ std::string s;
+ make_assignment_test(s)();
+ BOOST_TEST(s == "asd");
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug4853.cpp b/src/boost/libs/phoenix/test/regression/bug4853.cpp
new file mode 100644
index 000000000..09a875b1a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug4853.cpp
@@ -0,0 +1,79 @@
+/*==============================================================================
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+ Copyright (c) 2015 John Fletcher
+
+ 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 <utility> // for std::forward used by boost/range in some cases.
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/range.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/range/adaptor/transformed.hpp>
+#include <boost/range/adaptor/uniqued.hpp>
+#include <boost/range/algorithm_ext/push_back.hpp>
+
+#include <vector>
+#include <string>
+#include <iostream>
+
+
+namespace phoenix = boost::phoenix;
+
+struct Foo {
+ Foo(const std::string& name, int value)
+ : name_(name)
+ , value_(value)
+ { }
+
+ std::string name_; int value_;
+};
+
+typedef boost::shared_ptr<Foo> FooPtr;
+
+int range_test_complex() {
+ typedef std::vector<FooPtr> V;
+
+ V source;
+
+ source.push_back(boost::make_shared<Foo>("Foo", 10));
+ source.push_back(boost::make_shared<Foo>("Bar", 20));
+ source.push_back(boost::make_shared<Foo>("Baz", 30));
+ source.push_back(boost::make_shared<Foo>("Baz", 30)); //duplicate is here
+
+ std::vector<std::string> result1;
+ std::vector<int> result2;
+
+ using namespace boost::adaptors;
+ using phoenix::arg_names::arg1;
+
+ // This is failing for gcc 4.4 and 4.5 - reason not identified.
+#if ((BOOST_GCC_VERSION < 40400) || (BOOST_GCC_VERSION >= 40600))
+ boost::push_back(result1, source | transformed(phoenix::bind(&Foo::name_, *arg1)) | uniqued);
+
+ for(unsigned i = 0; i < result1.size(); ++i)
+ std::cout << result1[i] << "\n";
+#endif
+
+// This is failing for gcc 4.4 and 4.5 - reason not identified.
+#if !(BOOST_GCC_VERSION < 40600)
+ boost::push_back(result2, source | transformed(phoenix::bind(&Foo::value_, *arg1)) | uniqued);
+
+ for(unsigned i = 0; i < result2.size(); ++i)
+ std::cout << result2[i] << "\n";
+#endif
+
+ return 0;
+
+}
+
+int main()
+{
+ return range_test_complex();
+}
+
diff --git a/src/boost/libs/phoenix/test/regression/bug5626.cpp b/src/boost/libs/phoenix/test/regression/bug5626.cpp
new file mode 100644
index 000000000..6f277cab5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug5626.cpp
@@ -0,0 +1,26 @@
+/*==============================================================================
+ 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 <utility> // for std::forward used by boost/range in some cases.
+#include <boost/range.hpp>
+#include <boost/range/irange.hpp>
+#include <boost/range/adaptors.hpp>
+#include <boost/phoenix.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using namespace boost::phoenix::arg_names;
+using namespace boost::adaptors;
+
+int foo() { return 5; }
+
+int main()
+{
+ BOOST_TEST((*boost::begin(boost::irange(0,5) | transformed( arg1)) == 0));
+
+ boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug5824.cpp b/src/boost/libs/phoenix/test/regression/bug5824.cpp
new file mode 100644
index 000000000..43609904f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug5824.cpp
@@ -0,0 +1,25 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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)
+==============================================================================*/
+
+// Check for Bug5824
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+#include <boost/core/lightweight_test.hpp>
+
+using namespace boost::phoenix::arg_names;
+
+int main()
+{
+ int a = 0;
+ (++arg1, ++arg1)(a);
+ BOOST_TEST(a == 2);
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug5875.cpp b/src/boost/libs/phoenix/test/regression/bug5875.cpp
new file mode 100644
index 000000000..689c5808b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug5875.cpp
@@ -0,0 +1,23 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+
+ 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.hpp>
+#include <vector>
+
+#include <boost/detail/lightweight_test.hpp>
+
+namespace phx = boost::phoenix;
+
+int main()
+{
+ std::vector<int> v = phx::let(phx::local_names::_a = std::vector<int>(3))
+ [
+ phx::local_names::_a
+ ]
+ ();
+ BOOST_TEST( v.size() == 3);
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug5968.cpp b/src/boost/libs/phoenix/test/regression/bug5968.cpp
new file mode 100644
index 000000000..113360a0b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug5968.cpp
@@ -0,0 +1,27 @@
+/*==============================================================================
+ 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.hpp>
+#include <boost/signals2.hpp>
+
+struct s
+{
+ bool f(int, bool) { return true; }
+};
+
+int main()
+{
+ s s_obj;
+ boost::signals2::signal<bool (int, bool)> sig;
+ sig.connect(
+ boost::phoenix::bind(
+ &s::f, &s_obj,
+ boost::phoenix::placeholders::arg1,
+ boost::phoenix::placeholders::arg2));
+}
+
diff --git a/src/boost/libs/phoenix/test/regression/bug6040.cpp b/src/boost/libs/phoenix/test/regression/bug6040.cpp
new file mode 100644
index 000000000..dce413cb7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug6040.cpp
@@ -0,0 +1,22 @@
+/*==============================================================================
+ 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.hpp>
+#include <vector>
+#include <algorithm>
+#include <sstream>
+
+int main()
+{
+ std::vector<unsigned char> data;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::static_cast_;
+ std::ostringstream oss;
+ oss << std::hex;
+ std::for_each(data.begin(),data.end(), static_cast_<unsigned int>(_1) );
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug6268.cpp b/src/boost/libs/phoenix/test/regression/bug6268.cpp
new file mode 100644
index 000000000..978d1a0ea
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug6268.cpp
@@ -0,0 +1,29 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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/fusion/sequence/comparison.hpp>
+#include <boost/fusion/sequence/sequence_facade.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/comparison.hpp>
+
+struct foo : boost::fusion::sequence_facade<foo, boost::fusion::random_access_traversal_tag>
+{
+ // Rest of the sequence_facade extension mechanism code omitted,
+ // as it is not needed to reproduce the error
+
+ foo() : x(), y() {}
+
+ int x;
+ int y;
+};
+
+int main()
+{
+ (void)(boost::phoenix::arg_names::arg1 < foo());
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug7165.cpp b/src/boost/libs/phoenix/test/regression/bug7165.cpp
new file mode 100644
index 000000000..b78045593
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug7165.cpp
@@ -0,0 +1,15 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014-2015 John Fletcher
+
+ 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)
+==============================================================================*/
+
+#define BOOST_PHOENIX_LIMIT 20
+#include <boost/phoenix/core/limits.hpp>
+
+int main()
+{
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug7166.cpp b/src/boost/libs/phoenix/test/regression/bug7166.cpp
new file mode 100644
index 000000000..1b3bc76b2
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug7166.cpp
@@ -0,0 +1,16 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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)
+==============================================================================*/
+
+#define BOOST_PROTO_MAX_ARITY 10
+#define BOOST_PHOENIX_LIMIT 20
+#include <boost/phoenix/core.hpp>
+
+int main()
+{
+}
diff --git a/src/boost/libs/phoenix/test/regression/bug7624.cpp b/src/boost/libs/phoenix/test/regression/bug7624.cpp
new file mode 100644
index 000000000..f53c6bc5c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/bug7624.cpp
@@ -0,0 +1,31 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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.hpp>
+#include <boost/range/as_literal.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+using namespace boost::phoenix::placeholders;
+using namespace boost::phoenix;
+
+int main()
+{
+ char X('x');
+ find(boost::as_literal("fox"), 'x')(); // works
+#if !(defined (BOOST_NO_CXX11_DECLTYPE) || \
+ defined (BOOST_INTEL_CXX_VERSION) || \
+ (BOOST_GCC_VERSION < 40500) )
+ const char *Y = find(boost::as_literal("fox"), arg1)('x'); // works for C++11
+#else
+ const char *Y = find(boost::as_literal("fox"), construct<char>(arg1))('x'); // works
+#endif
+ BOOST_TEST(X == *Y);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/regression/from_array.cpp b/src/boost/libs/phoenix/test/regression/from_array.cpp
new file mode 100644
index 000000000..b7da48301
--- /dev/null
+++ b/src/boost/libs/phoenix/test/regression/from_array.cpp
@@ -0,0 +1,60 @@
+/*=============================================================================
+ Copyright (c) 2017 Nikita Kniazev
+
+ 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/object.hpp>
+#include <boost/phoenix/scope.hpp>
+#include <boost/phoenix/operator.hpp>
+
+#include <string>
+#include <iostream>
+
+template <typename T, std::size_t N>
+struct array_holder
+{
+ typedef T underlying_type[N];
+
+ array_holder(underlying_type const& x)
+ {
+ for (std::size_t i = 0; i < N; ++i) elems_[i] = x[i];
+ }
+
+ T elems_[N];
+
+ friend std::ostream& operator<<(std::ostream& os, array_holder const& x)
+ {
+ os << x.elems_[0];
+ for (std::size_t i = 1; i < N; ++i) os << ", " << x.elems_[i];
+ return os;
+ }
+};
+
+int main()
+{
+ using boost::phoenix::construct;
+ using boost::phoenix::let;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ let(_a = construct<std::string>("str"))
+ [
+ std::cout << _a << std::endl
+ ]();
+
+ let(_a = construct<array_holder<char, 4> >("str"))
+ [
+ std::cout << _a << std::endl
+ ]();
+
+ int ints[] = { 1, 2, 3 };
+ let(_a = construct<array_holder<int, sizeof(ints) / sizeof(ints[0])> >(ints) )
+ [
+ std::cout << _a << std::endl
+ ]();
+
+ return 0;
+}
diff --git a/src/boost/libs/phoenix/test/scope/bug3289.cpp b/src/boost/libs/phoenix/test/scope/bug3289.cpp
new file mode 100644
index 000000000..f54d5e1d5
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/bug3289.cpp
@@ -0,0 +1,37 @@
+/*==============================================================================
+ 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 <algorithm>
+#include <vector>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/scope.hpp>
+#include <boost/phoenix/stl.hpp>
+
+namespace phx = boost::phoenix;
+using namespace boost::phoenix;
+using namespace boost::phoenix::arg_names;
+using namespace boost::phoenix::local_names;
+
+int main()
+{
+ std::vector<int> u(11,1);
+ std::vector<int> w(11,2);
+ std::vector<int>::const_iterator it=w.begin();
+
+ boost::phoenix::generate(phx::ref(u), lambda(_a=*phx::ref(it)++)[_a*2])();
+
+ BOOST_TEST(std::accumulate(u.begin(), u.end(), 0) == 44);
+
+ BOOST_TEST(lambda(_a=*phx::ref(it)++)[_a*2]()() == 4);
+
+ return boost::report_errors();
+}
+
+
diff --git a/src/boost/libs/phoenix/test/scope/bug8298.cpp b/src/boost/libs/phoenix/test/scope/bug8298.cpp
new file mode 100644
index 000000000..42cd8ab64
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/bug8298.cpp
@@ -0,0 +1,33 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+ 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.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+
+namespace phoenix = boost::phoenix;
+using boost::phoenix::ref;
+using namespace phoenix::local_names;
+using boost::phoenix::arg_names::_1;
+
+int main(int argc, char *argv[])
+{
+ int x = 17;
+ int y = phoenix::lambda(_a=ref(x))
+ [
+ _a = 18
+ ]()();
+ BOOST_TEST(y==18);
+
+ int z = phoenix::lambda(_a=_1)
+ [
+ _a = 18
+ ](x)();
+ std::cout << z << std::endl;
+ BOOST_TEST(y==18);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/bug8298f.cpp b/src/boost/libs/phoenix/test/scope/bug8298f.cpp
new file mode 100644
index 000000000..ad7327efa
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/bug8298f.cpp
@@ -0,0 +1,24 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+ 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.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+
+namespace phoenix = boost::phoenix;
+using namespace phoenix::local_names;
+using boost::phoenix::arg_names::_1;
+
+int main(int argc, char *argv[])
+{
+ int y = phoenix::lambda(_a=_1)
+ [
+ _a = 18
+ ](17)();
+ BOOST_TEST(y==18);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/bug_000008.cpp b/src/boost/libs/phoenix/test/scope/bug_000008.cpp
new file mode 100644
index 000000000..58adf4171
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/bug_000008.cpp
@@ -0,0 +1,105 @@
+/*=============================================================================
+ Copyright (c) 2003 Martin Wille
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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)
+=============================================================================*/
+
+ // see http://article.gmane.org/gmane.comp.parsers.spirit.general/4575
+ // or https://sf.net/mailarchive/forum.php?thread_id=2692308&forum_id=1595
+ // for a description of the bug being tested for by this program
+ //
+ // This code is borrowed from Spirit's bug_000008.cpp test for multithreads.
+ // Now modified to point to the Phoenix headers
+ // instead of the ones in Spirit.
+#include <iostream>
+#include <boost/config.hpp>
+#include <boost/assert.hpp>
+#include <boost/detail/lightweight_test.hpp>
+ // Testing problems in thread/future
+//#include <boost/move/move.hpp>
+//#include <boost/move/detail/type_traits.hpp>
+//using boost::move_detail::is_copy_constructible;
+#include <boost/phoenix/scope/dynamic.hpp>
+
+#if defined(DONT_HAVE_BOOST) \
+ || !defined(BOOST_HAS_THREADS) \
+ || defined(BOOST_DISABLE_THREADS) \
+ || (defined(__GNUC__) && defined(__WIN32__)) // MinGW
+#define SKIP_TEST
+#endif
+
+
+#if defined(SKIP_TEST)
+// we end here if we can't do multithreading
+static void skipped()
+{
+ std::cout << "skipped\n";
+}
+
+int
+main()
+{
+ skipped();
+ return boost::report_errors();
+}
+
+#else
+// the real MT stuff
+
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/scope.hpp>
+#include <boost/thread.hpp>
+
+static const int number_of_calls_per_thread=20000;
+
+struct test_dynamic : boost::phoenix::dynamic<int>
+{
+ // test_dynamic() : b(*this) {}
+ test_dynamic() : b(init<0>(this)) {}
+ member1 b;
+};
+
+void
+in_thread(void)
+{
+ test_dynamic s; // should now be a local
+
+ for (int i = 0; i < number_of_calls_per_thread; ++i)
+ {
+ boost::phoenix::dynamic_frame<test_dynamic::self_type> frame(s);
+ (s.b = 123)();
+ {
+ boost::phoenix::dynamic_frame<test_dynamic::self_type> frame(s);
+ (s.b = 456)();
+ BOOST_ASSERT((s.b == 456)());
+ }
+ BOOST_ASSERT((s.b == 123)());
+ }
+}
+
+void
+bug_000008()
+{
+ boost::thread t1(in_thread);
+ boost::thread t2(in_thread);
+ boost::thread t3(in_thread);
+ boost::thread t4(in_thread);
+
+ t1.join();
+ t2.join();
+ t3.join();
+ t4.join();
+}
+
+int
+main()
+{
+ bug_000008();
+ return boost::report_errors();
+}
+
+#endif
+
diff --git a/src/boost/libs/phoenix/test/scope/dynamic_tests.cpp b/src/boost/libs/phoenix/test/scope/dynamic_tests.cpp
new file mode 100644
index 000000000..8751d1814
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/dynamic_tests.cpp
@@ -0,0 +1,75 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <string>
+#include <cmath>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/scope/dynamic.hpp>
+
+struct my_dynamic : ::boost::phoenix::dynamic<int, std::string, double>
+{
+ my_dynamic() : num(init<0>(this)), message(init<1>(this)), real(init<2>(this)) {}
+
+ member1 num;
+ member2 message;
+ member3 real;
+};
+
+// You may also use the macro below to achieve the same as above:
+//
+//BOOST_PHOENIX_DYNAMIC(
+// my_dynamic,
+// (int, num)
+// (std::string, message)
+// (double, real)
+//);
+
+int
+main()
+{
+ using namespace boost::phoenix;
+ using namespace boost::phoenix::arg_names;
+
+ my_dynamic clos;
+
+ { // First stack frame
+ dynamic_frame<my_dynamic::self_type> frame(clos);
+ (clos.num = 123)();
+ (clos.num += 456)();
+ (clos.real = clos.num / 56.5)();
+ (clos.message = "Hello " + std::string("World "))();
+
+ { // Second stack frame
+ dynamic_frame<my_dynamic::self_type> frame(clos);
+ (clos.num = 987)();
+ (clos.message = std::string("Abracadabra "))();
+ (clos.real = clos.num * 1e30)();
+
+ { // Third stack frame
+ boost::phoenix::vector3<int, std::string, 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_TEST(clos.num() == -1);
+ BOOST_TEST(clos.message() == "Direct Init ");
+ }
+
+ (std::cout << clos.message << clos.num << ", " << clos.real << '\n')();
+ BOOST_TEST(clos.num() == 987);
+ BOOST_TEST(clos.message() == "Abracadabra ");
+ }
+
+ (std::cout << clos.message << clos.num << ", " << clos.real << '\n')();
+ BOOST_TEST(clos.num() == 123+456);
+ BOOST_TEST(clos.message() == "Hello " + std::string("World "));
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests1.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests1.cpp
new file mode 100644
index 000000000..4c3b4e7a7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests1.cpp
@@ -0,0 +1,23 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+
+ int x = 1;
+ int y = lambda[_1]()(x);
+ BOOST_TEST(x == y);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests10.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests10.cpp
new file mode 100644
index 000000000..27b6f1696
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests10.cpp
@@ -0,0 +1,35 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+struct zzz {};
+
+int main()
+{
+#if defined(RUNNING_ON_APPVEYOR) && BOOST_WORKAROUND(BOOST_MSVC, == 1800)
+ // skip test
+#else
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1;
+ char const* y = "hello";
+ zzz z;
+ BOOST_TEST(lambda(_a = _1)[lambda[_a]](x)(y)(z) == x);
+
+ return boost::report_errors();
+#endif
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests11.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests11.cpp
new file mode 100644
index 000000000..35fb8ce4c
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests11.cpp
@@ -0,0 +1,33 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+#if defined(RUNNING_ON_APPVEYOR) && BOOST_WORKAROUND(BOOST_MSVC, == 1800)
+ // skip test
+#else
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1;
+ char const* y = "hello";
+ int xx = 20;
+ BOOST_TEST(lambda(_a = _1)[lambda[_a]](x)(y)(xx) == x);
+
+ return boost::report_errors();
+#endif
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests12.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests12.cpp
new file mode 100644
index 000000000..f355b313d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests12.cpp
@@ -0,0 +1,26 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1;
+ char const* y = "hello";
+ BOOST_TEST(lambda(_a = _1)[lambda[_a + _1]](x)(y)(x) == 2);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests13.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests13.cpp
new file mode 100644
index 000000000..57c0a52ec
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests13.cpp
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+
+ int x = 1;
+ long x2 = 2;
+ short x3 = 3;
+ BOOST_TEST(lambda(_a = _1)[lambda(_b = _1)[_a + _b + _1]](x)(x2)(x3) == 6);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests14.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests14.cpp
new file mode 100644
index 000000000..b504bf299
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests14.cpp
@@ -0,0 +1,34 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+#if defined(RUNNING_ON_APPVEYOR) && BOOST_WORKAROUND(BOOST_MSVC, == 1800)
+ // skip test
+#else
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda(_a = _1)[_a + lambda[_a + 2]])(x)(y)(y) == 1+1+1+2
+ );
+
+ return boost::report_errors();
+#endif
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests15.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests15.cpp
new file mode 100644
index 000000000..c2d083136
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests15.cpp
@@ -0,0 +1,34 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahshi
+
+ 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>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+#if defined(RUNNING_ON_APPVEYOR) && BOOST_WORKAROUND(BOOST_MSVC, == 1800)
+ // skip test
+#else
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda(_a = _1)[_a + lambda[_a + 2]])(x)()(x) == 1+1+1+2
+ );
+
+ return boost::report_errors();
+#endif
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests16.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests16.cpp
new file mode 100644
index 000000000..0ca0301f1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests16.cpp
@@ -0,0 +1,25 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + _1 + lambda[_1 + 2])(x)(y) == 1+1+10+2
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests17.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests17.cpp
new file mode 100644
index 000000000..137bb95ca
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests17.cpp
@@ -0,0 +1,27 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahsahi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda(_a = _1)[_a + _1 + 2])(x)(y) == 1+1+10+2
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests18.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests18.cpp
new file mode 100644
index 000000000..fc3b30250
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests18.cpp
@@ -0,0 +1,36 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahsahi
+
+ 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 <vector>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+#include <boost/phoenix/stl/container.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::for_each;
+
+ int init[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ std::vector<int> v(init, init+10);
+
+ int x = 0;
+ for_each(_1, lambda(_a = _2)[_a += _1])(v, x);
+ BOOST_TEST(x == 55);
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests19.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests19.cpp
new file mode 100644
index 000000000..c2002f6a8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests19.cpp
@@ -0,0 +1,41 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahsahi
+
+ 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 <vector>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+#include <boost/phoenix/stl/algorithm/iteration.hpp>
+#include <boost/phoenix/stl/container.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::placeholders::arg1;
+
+ using boost::phoenix::for_each;
+ using boost::phoenix::push_back;
+
+ int x = 10;
+ std::vector<std::vector<int> > v(10);
+ for_each(_1, lambda(_a = _2)[push_back(_1, _a)])(v, x);
+
+ int y = 0;
+ for_each(arg1, lambda[ref(y) += _1[0]])(v);
+ BOOST_TEST(y == 100);
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests2.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests2.cpp
new file mode 100644
index 000000000..8c5029922
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests2.cpp
@@ -0,0 +1,25 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda[_1 + 2])(x)(y) == 1+10+2
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests20.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests20.cpp
new file mode 100644
index 000000000..29e42ad3f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests20.cpp
@@ -0,0 +1,29 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ lambda(_a = _1, _b = _2)[_1 + _a + _b](x, z)(y) == x + y + z
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests21.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests21.cpp
new file mode 100644
index 000000000..493b1d3e3
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests21.cpp
@@ -0,0 +1,29 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+#include <boost/phoenix/scope/let.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::let;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+
+ int i = 0;
+ int j = 2;
+ BOOST_TEST(lambda[let(_a = _1)[_a = _2]]()(i, j) == j);
+ BOOST_TEST(i == j);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests22.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests22.cpp
new file mode 100644
index 000000000..859d27223
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests22.cpp
@@ -0,0 +1,30 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+#include <boost/phoenix/scope/let.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::local_names::_a;
+
+ int x = (let(_a = lambda[val(1)])[bind(_a)])();
+ BOOST_TEST(x == 1);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests23.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests23.cpp
new file mode 100644
index 000000000..62d7f92c3
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests23.cpp
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+#include <boost/phoenix/scope/let.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = (let(_a = _1)[bind(_a)])(lambda[val(1)]());
+ BOOST_TEST(x == 1);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests3.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests3.cpp
new file mode 100644
index 000000000..dea0ccc3b
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests3.cpp
@@ -0,0 +1,25 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda[-_1])(x)(y) == 1+-10
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests4.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests4.cpp
new file mode 100644
index 000000000..1e253569a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests4.cpp
@@ -0,0 +1,33 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ lambda(_a = _1, _b = _2)
+ [
+ _1 + _a + _b
+ ]
+ (x, z)(y) == x + y + z
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests5.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests5.cpp
new file mode 100644
index 000000000..564980b4f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests5.cpp
@@ -0,0 +1,27 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 4;
+ int y = 5;
+ lambda(_a = _1)[_a = 555](x)();
+ BOOST_TEST(x == 555);
+ (void)y;
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests6.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests6.cpp
new file mode 100644
index 000000000..47535e652
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests6.cpp
@@ -0,0 +1,27 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda(_a = _1)[_a + _1 + 2])(x)(y) == 1+1+10+2
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests7.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests7.cpp
new file mode 100644
index 000000000..815485ddf
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests7.cpp
@@ -0,0 +1,34 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/arithmetic.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+#if defined(RUNNING_ON_APPVEYOR) && BOOST_WORKAROUND(BOOST_MSVC, == 1800)
+ // skip test
+#else
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1, y = 10;
+ BOOST_TEST(
+ (_1 + lambda(_a = _1)[_a + lambda[_a + 2]])(x)(y)(y) == 1+1+1+2
+ );
+
+ return boost::report_errors();
+#endif
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests8.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests8.cpp
new file mode 100644
index 000000000..6f0a25451
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests8.cpp
@@ -0,0 +1,23 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+
+ int x = 1;
+ char const* y = "hello";
+ BOOST_TEST(lambda[_1](x)(y) == y);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/lambda_tests9.cpp b/src/boost/libs/phoenix/test/scope/lambda_tests9.cpp
new file mode 100644
index 000000000..bd7fe30b6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/lambda_tests9.cpp
@@ -0,0 +1,25 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+ Copyright (c) 2018 Kohei Takahashi
+
+ 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/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator/self.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
+
+int main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+
+ int x = 1;
+ char const* y = "hello";
+ BOOST_TEST(lambda(_a = _1)[_a](x)(y) == x);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/let_tests.cpp b/src/boost/libs/phoenix/test/scope/let_tests.cpp
new file mode 100644
index 000000000..26fa916fc
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/let_tests.cpp
@@ -0,0 +1,204 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+#include <boost/phoenix/object/construct.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::arg_names::_3;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ using boost::phoenix::local_names::_c;
+ using boost::phoenix::local_names::_d;
+ using boost::phoenix::local_names::_e;
+ using boost::phoenix::local_names::_x;
+ using boost::phoenix::local_names::_y;
+ using boost::phoenix::local_names::_z;
+ using boost::phoenix::placeholders::arg1;
+
+ {
+ int x = 1;
+ BOOST_TEST(
+ let(_a = _1)
+ [
+ _a
+ ]
+ (x) == x
+ )
+ ;
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_a = _1, _b = _2)
+ [
+ _a + _b
+ ]
+ (x, y) == x + y
+ );
+ }
+
+ {
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ let(_x = _1, _y = _2)
+ [
+ let(_z = _3)
+ [
+ _x + _y + _z
+ ]
+ ]
+ (x, y, z) == x + y + z
+ );
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_x = _1)
+ [
+ _x +
+ let(_x = _2)
+ [
+ -_x
+ ]
+ ]
+ (x, y) == x + -y
+ );
+ }
+
+ {
+ int x = 999;
+ BOOST_TEST(
+ let(_x = _1) // _x is a reference to x
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+
+ {
+ int x = 999;
+ /*
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ _x += 888
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ */
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888)
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ }
+
+ {
+ BOOST_TEST(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ () == 1 + 2 + 3 + 4 + 5
+ );
+ }
+
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ {
+ // disallow this:
+ int i;
+ (_a + _b)(i);
+ }
+#endif
+
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+#if defined(__OPTIMIZE__) && __OPTIMIZE__
+ int x = (let(_a = _2)[let(_b = _1)[ _a ]])(y,1);
+#else
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+#endif
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ // show that this code returns an lvalue
+ int i = 1;
+ let(_a = arg1)[ _a ](i)++;
+ BOOST_TEST(i == 2);
+ }
+
+ {
+ // show that what you put in is what you get out
+ int i = 1;
+ int& j = let(_a = arg1)[_a](i);
+ BOOST_TEST(&i == &j);
+ }
+
+ {
+ // show that a let with a void result can compile
+ using boost::phoenix::construct;
+
+ let(_a = 1)[ // need at least one expression here
+ construct<void>() // produce a void result
+ ]();
+ }
+
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
+ {
+ int i = 0;
+ let(_a = _1)[_a = _2](i, 2);
+ BOOST_TEST(i == 2);
+ }
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/let_tests_113.cpp b/src/boost/libs/phoenix/test/scope/let_tests_113.cpp
new file mode 100644
index 000000000..c8ebea171
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/let_tests_113.cpp
@@ -0,0 +1,204 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::ref;
+ using boost::phoenix::arg_names::_1;
+ //using boost::phoenix::arg_names::_2;
+ //using boost::phoenix::arg_names::_3;
+ //using boost::phoenix::local_names::_a;
+ //using boost::phoenix::local_names::_b;
+ //using boost::phoenix::local_names::_c;
+ //using boost::phoenix::local_names::_d;
+ //using boost::phoenix::local_names::_e;
+ using boost::phoenix::local_names::_x;
+ //using boost::phoenix::local_names::_y;
+ //using boost::phoenix::local_names::_z;
+ //using boost::phoenix::placeholders::arg1;
+ /*
+ {
+ int x = 1;
+ BOOST_TEST(
+ let(_a = _1)
+ [
+ _a
+ ]
+ (x) == x
+ )
+ ;
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_a = _1, _b = _2)
+ [
+ _a + _b
+ ]
+ (x, y) == x + y
+ );
+ }
+
+ {
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ let(_x = _1, _y = _2)
+ [
+ let(_z = _3)
+ [
+ _x + _y + _z
+ ]
+ ]
+ (x, y, z) == x + y + z
+ );
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_x = _1)
+ [
+ _x +
+ let(_x = _2)
+ [
+ -_x
+ ]
+ ]
+ (x, y) == x + -y
+ );
+ }
+
+ {
+ int x = 999;
+ BOOST_TEST(
+ let(_x = _1) // _x is a reference to x
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+ */
+ {
+ int x = 999;
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888) // so use value here too.
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ /*
+ BOOST_TEST(
+ let(_x = ref(_1)) // _x holds x by reference
+ [
+ _x += 888
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ */
+
+ BOOST_TEST(
+ let( _x = _1 ) // _x holds x by reference
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+ /*
+ {
+ BOOST_TEST(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ () == 1 + 2 + 3 + 4 + 5
+ );
+ }
+
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ {
+ // disallow this:
+ int i;
+ (_a + _b)(i);
+ }
+#endif
+
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ // show that this code returns an lvalue
+ int i = 1;
+ let(_a = arg1)[ _a ](i)++;
+ BOOST_TEST(i == 2);
+ }
+
+ {
+ // show that what you put in is what you get out
+ int i = 1;
+ int& j = let(_a = arg1)[_a](i);
+ BOOST_TEST(&i == &j);
+ }
+
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
+ {
+ int i = 0;
+ let(_a = _1)[_a = _2](i, 2);
+ BOOST_TEST(i == 2);
+ }
+ */
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/let_tests_113a.cpp b/src/boost/libs/phoenix/test/scope/let_tests_113a.cpp
new file mode 100644
index 000000000..6d84e4848
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/let_tests_113a.cpp
@@ -0,0 +1,192 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ //using boost::phoenix::arg_names::_2;
+ //using boost::phoenix::arg_names::_3;
+ //using boost::phoenix::local_names::_a;
+ //using boost::phoenix::local_names::_b;
+ //using boost::phoenix::local_names::_c;
+ //using boost::phoenix::local_names::_d;
+ //using boost::phoenix::local_names::_e;
+ using boost::phoenix::local_names::_x;
+ //using boost::phoenix::local_names::_y;
+ //using boost::phoenix::local_names::_z;
+ //using boost::phoenix::placeholders::arg1;
+ /*
+ {
+ int x = 1;
+ BOOST_TEST(
+ let(_a = _1)
+ [
+ _a
+ ]
+ (x) == x
+ )
+ ;
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_a = _1, _b = _2)
+ [
+ _a + _b
+ ]
+ (x, y) == x + y
+ );
+ }
+
+ {
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ let(_x = _1, _y = _2)
+ [
+ let(_z = _3)
+ [
+ _x + _y + _z
+ ]
+ ]
+ (x, y, z) == x + y + z
+ );
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_x = _1)
+ [
+ _x +
+ let(_x = _2)
+ [
+ -_x
+ ]
+ ]
+ (x, y) == x + -y
+ );
+ }
+
+ {
+ int x = 999;
+ BOOST_TEST(
+ let(_x = _1) // _x is a reference to x
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+ */
+ {
+ int x = 999;
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888)
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ /*
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888)
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999); */
+ }
+ /*
+ {
+ BOOST_TEST(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ () == 1 + 2 + 3 + 4 + 5
+ );
+ }
+
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ {
+ // disallow this:
+ int i;
+ (_a + _b)(i);
+ }
+#endif
+
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ // show that this code returns an lvalue
+ int i = 1;
+ let(_a = arg1)[ _a ](i)++;
+ BOOST_TEST(i == 2);
+ }
+
+ {
+ // show that what you put in is what you get out
+ int i = 1;
+ int& j = let(_a = arg1)[_a](i);
+ BOOST_TEST(&i == &j);
+ }
+
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
+ {
+ int i = 0;
+ let(_a = _1)[_a = _2](i, 2);
+ BOOST_TEST(i == 2);
+ }
+ */
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/let_tests_157.cpp b/src/boost/libs/phoenix/test/scope/let_tests_157.cpp
new file mode 100644
index 000000000..7979cea4f
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/let_tests_157.cpp
@@ -0,0 +1,194 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ //using boost::phoenix::arg_names::_3;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ //using boost::phoenix::local_names::_c;
+ //using boost::phoenix::local_names::_d;
+ //using boost::phoenix::local_names::_e;
+ //using boost::phoenix::local_names::_x;
+ //using boost::phoenix::local_names::_y;
+ //using boost::phoenix::local_names::_z;
+ //using boost::phoenix::placeholders::arg1;
+ /*
+ {
+ int x = 1;
+ BOOST_TEST(
+ let(_a = _1)
+ [
+ _a
+ ]
+ (x) == x
+ )
+ ;
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_a = _1, _b = _2)
+ [
+ _a + _b
+ ]
+ (x, y) == x + y
+ );
+ }
+
+ {
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ let(_x = _1, _y = _2)
+ [
+ let(_z = _3)
+ [
+ _x + _y + _z
+ ]
+ ]
+ (x, y, z) == x + y + z
+ );
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_x = _1)
+ [
+ _x +
+ let(_x = _2)
+ [
+ -_x
+ ]
+ ]
+ (x, y) == x + -y
+ );
+ }
+
+ {
+ int x = 999;
+ BOOST_TEST(
+ let(_x = _1) // _x is a reference to x
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+
+ {
+ int x = 999;
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ _x += 888
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888)
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ }
+
+ {
+ BOOST_TEST(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ () == 1 + 2 + 3 + 4 + 5
+ );
+ }
+
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ {
+ // disallow this:
+ int i;
+ (_a + _b)(i);
+ }
+#endif
+ */
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+#if defined(__OPTIMIZE__) && __OPTIMIZE__
+ int x = (let(_a = _2)[let(_b = _1)[ _a ]])(y,1);
+#else
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+#endif
+ BOOST_TEST(x == 1);
+ }
+ /*
+ {
+ // show that this code returns an lvalue
+ int i = 1;
+ let(_a = arg1)[ _a ](i)++;
+ BOOST_TEST(i == 2);
+ }
+
+ {
+ // show that what you put in is what you get out
+ int i = 1;
+ int& j = let(_a = arg1)[_a](i);
+ BOOST_TEST(&i == &j);
+ }
+
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
+ {
+ int i = 0;
+ let(_a = _1)[_a = _2](i, 2);
+ BOOST_TEST(i == 2);
+ }
+ */
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/let_tests_157a.cpp b/src/boost/libs/phoenix/test/scope/let_tests_157a.cpp
new file mode 100644
index 000000000..83dd33ac8
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/let_tests_157a.cpp
@@ -0,0 +1,191 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ //using boost::phoenix::arg_names::_3;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ //using boost::phoenix::local_names::_c;
+ //using boost::phoenix::local_names::_d;
+ //using boost::phoenix::local_names::_e;
+ //using boost::phoenix::local_names::_x;
+ //using boost::phoenix::local_names::_y;
+ //using boost::phoenix::local_names::_z;
+ //using boost::phoenix::placeholders::arg1;
+ /*
+ {
+ int x = 1;
+ BOOST_TEST(
+ let(_a = _1)
+ [
+ _a
+ ]
+ (x) == x
+ )
+ ;
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_a = _1, _b = _2)
+ [
+ _a + _b
+ ]
+ (x, y) == x + y
+ );
+ }
+
+ {
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ let(_x = _1, _y = _2)
+ [
+ let(_z = _3)
+ [
+ _x + _y + _z
+ ]
+ ]
+ (x, y, z) == x + y + z
+ );
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_x = _1)
+ [
+ _x +
+ let(_x = _2)
+ [
+ -_x
+ ]
+ ]
+ (x, y) == x + -y
+ );
+ }
+
+ {
+ int x = 999;
+ BOOST_TEST(
+ let(_x = _1) // _x is a reference to x
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+
+ {
+ int x = 999;
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ _x += 888
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888)
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ }
+
+ {
+ BOOST_TEST(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ () == 1 + 2 + 3 + 4 + 5
+ );
+ }
+
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ {
+ // disallow this:
+ int i;
+ (_a + _b)(i);
+ }
+#endif
+ */
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = _2)[let(_b = _1)[ _a ]])(y,1);
+
+ BOOST_TEST(x == 1);
+ }
+ /*
+ {
+ // show that this code returns an lvalue
+ int i = 1;
+ let(_a = arg1)[ _a ](i)++;
+ BOOST_TEST(i == 2);
+ }
+
+ {
+ // show that what you put in is what you get out
+ int i = 1;
+ int& j = let(_a = arg1)[_a](i);
+ BOOST_TEST(&i == &j);
+ }
+
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
+ {
+ int i = 0;
+ let(_a = _1)[_a = _2](i, 2);
+ BOOST_TEST(i == 2);
+ }
+ */
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/let_tests_rest.cpp b/src/boost/libs/phoenix/test/scope/let_tests_rest.cpp
new file mode 100644
index 000000000..9200d31d9
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/let_tests_rest.cpp
@@ -0,0 +1,192 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::arg_names::_3;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ using boost::phoenix::local_names::_c;
+ using boost::phoenix::local_names::_d;
+ using boost::phoenix::local_names::_e;
+ using boost::phoenix::local_names::_x;
+ using boost::phoenix::local_names::_y;
+ using boost::phoenix::local_names::_z;
+ using boost::phoenix::placeholders::arg1;
+
+ {
+ int x = 1;
+ BOOST_TEST(
+ let(_a = _1)
+ [
+ _a
+ ]
+ (x) == x
+ )
+ ;
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_a = _1, _b = _2)
+ [
+ _a + _b
+ ]
+ (x, y) == x + y
+ );
+ }
+
+ {
+ int x = 1, y = 10, z = 13;
+ BOOST_TEST(
+ let(_x = _1, _y = _2)
+ [
+ let(_z = _3)
+ [
+ _x + _y + _z
+ ]
+ ]
+ (x, y, z) == x + y + z
+ );
+ }
+
+ {
+ int x = 1, y = 10;
+ BOOST_TEST(
+ let(_x = _1)
+ [
+ _x +
+ let(_x = _2)
+ [
+ -_x
+ ]
+ ]
+ (x, y) == x + -y
+ );
+ }
+
+ {
+ int x = 999;
+ BOOST_TEST(
+ let(_x = _1) // _x is a reference to x
+ [
+ _x += 888
+ ]
+ (x) == 999 + 888
+ );
+
+ BOOST_TEST(x == 888 + 999);
+ }
+ /*
+ {
+ int x = 999;
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ _x += 888
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+
+ BOOST_TEST(
+ let(_x = val(_1)) // _x holds x by value
+ [
+ val(_x += 888)
+ ]
+ (x) == x + 888
+ );
+
+ BOOST_TEST(x == 999);
+ }
+ */
+ {
+ BOOST_TEST(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ () == 1 + 2 + 3 + 4 + 5
+ );
+ }
+
+#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
+ {
+ // disallow this:
+ int i;
+ (_a + _b)(i);
+ }
+#endif
+ /*
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ */
+ {
+ // show that this code returns an lvalue
+ int i = 1;
+ let(_a = arg1)[ _a ](i)++;
+ BOOST_TEST(i == 2);
+ }
+
+ {
+ // show that what you put in is what you get out
+ int i = 1;
+ int& j = let(_a = arg1)[_a](i);
+ BOOST_TEST(&i == &j);
+ }
+
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
+ {
+ int i = 0;
+ let(_a = _1)[_a = _2](i, 2);
+ BOOST_TEST(i == 2);
+ }
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/more_lambda_tests.cpp b/src/boost/libs/phoenix/test/scope/more_lambda_tests.cpp
new file mode 100644
index 000000000..ea9209dc7
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/more_lambda_tests.cpp
@@ -0,0 +1,48 @@
+/*=============================================================================
+ Copyright (c) 2014 John Fletcher
+
+ 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/detail/lightweight_test.hpp>
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/bind.hpp>
+#include <boost/phoenix/scope.hpp>
+
+
+int
+main()
+{
+ using boost::phoenix::lambda;
+ using boost::phoenix::let;
+ using boost::phoenix::ref;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ //using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ // using boost::phoenix::local_names::_b;
+ //using boost::phoenix::placeholders::arg1;
+
+ {
+ int x = 1;
+ int y = lambda[_1]()(x);
+ BOOST_TEST(x == y);
+ }
+
+ {
+ int x = 1;
+ int y = lambda(_a = _1)[_a+1](x)();
+ BOOST_TEST(x+1 == y);
+ }
+
+ {
+ int x = lambda[val(1)]()();
+ BOOST_TEST(x == 1);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/scope/more_let_tests.cpp b/src/boost/libs/phoenix/test/scope/more_let_tests.cpp
new file mode 100644
index 000000000..5950e6ef1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/more_let_tests.cpp
@@ -0,0 +1,156 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = 1)[let(_b = _1)[ _a + 0 ]])(y);
+#else
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+#endif
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = 0)[let(_b = _1)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ //int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = 1)[let(_b = _a)[ _a + 0 ]])();
+#else
+ int x = (let(_a = 1)[let(_b = _a)[ _a ]])();
+#endif
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ //int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = 1)[let(_b = _a)[ _b + 0 ]])();
+#else
+ int x = (let(_a = 1)[let(_b = _a)[ _b ]])();
+#endif
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ // Be very careful. Some of these cases give a silly answer
+ // with clang 3.4 with C++03 and work for C++11.
+ // gcc 4.8.2 seems O.K. both ways. Oh dear.
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ {
+ int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a + 0 ]])(y);
+#else
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a ]])(y);
+#endif
+ //std::cout << x << " P1A "; //clang - empty memory
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b + 0 ]])(y);
+#else
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b ]])(y);
+#endif
+ //std::cout << x << " P1B "; //clang - 42 value- one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ val(_a) ]])(y);
+#else
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _a ]])(y);
+#endif
+ //std::cout << x << " P2A "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ val(_b) ]])(y);
+#else
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
+#endif
+ //std::cout << x << " P2B "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 1;
+ int x = (let(_a = _1, _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P3 "; //clang - OK - one step better still
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ int y = 0;
+#ifdef __OPTIMIZE__
+ int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a + 0 ]])(y);
+#else
+ int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a ]])(y);
+#endif
+ // std::cout << x << " Q "; // clang 4201472
+ BOOST_TEST(x == 1);
+ }
+
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/more_let_tests1.cpp b/src/boost/libs/phoenix/test/scope/more_let_tests1.cpp
new file mode 100644
index 000000000..d4dddf1e4
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/more_let_tests1.cpp
@@ -0,0 +1,136 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 50000) && __OPTIMIZE__
+ int x = (let(_a = _2)[let(_b = _1)[ _a ]])(y,1);
+#else
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+#endif
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = 0)[let(_b = _1)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ //int y = 0;
+#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 50000) && __OPTIMIZE__
+ int x = (let(_a = 1)[let(_b = _a)[ _a ]])();
+#else
+ int x = (let(_a = _1)[let(_b = _a)[ _a ]])(1);
+#endif
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ //int y = 0;
+#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 50000) && __OPTIMIZE__
+ int x = (let(_a = _1)[let(_b = _a)[ _b ]])(1);
+#else
+ int x = (let(_a = 1)[let(_b = _a)[ _b ]])();
+#endif
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ // Be very careful. Some of these cases give a silly answer
+ // with clang 3.4 with C++03 and work for C++11.
+ // gcc 4.8.2 seems O.K. both ways. Oh dear.
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ /* {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P1A "; //clang - empty memory
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P1B "; //clang - 42 value- one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P2A "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P2B "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 1;
+ int x = (let(_a = _1, _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P3 "; //clang - OK - one step better still
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a ]])(y);
+ // std::cout << x << " Q "; // clang 4201472
+ BOOST_TEST(x == 1);
+ }
+ */
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/more_let_tests2.cpp b/src/boost/libs/phoenix/test/scope/more_let_tests2.cpp
new file mode 100644
index 000000000..fb3fff8c1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/more_let_tests2.cpp
@@ -0,0 +1,125 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ /*
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = 0)[let(_b = _1)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ //int y = 0;
+ int x = (let(_a = 1)[let(_b = _a)[ _a ]])();
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ //int y = 0;
+ int x = (let(_a = 1)[let(_b = _a)[ _b ]])();
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ */
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ // Be very careful. Some of these cases give a silly answer
+ // with clang 3.4 with C++03 and work for C++11.
+ // gcc 4.8.2 seems O.K. both ways. Oh dear.
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P1A "; //clang - empty memory
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P1B "; //clang - 42 value- one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P2A "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P2B "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 1;
+ int x = (let(_a = _1, _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P3 "; //clang - OK - one step better still
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a ]])(y);
+ // std::cout << x << " Q "; // clang 4201472
+ BOOST_TEST(x == 1);
+ }
+
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/more_let_tests2a.cpp b/src/boost/libs/phoenix/test/scope/more_let_tests2a.cpp
new file mode 100644
index 000000000..9a4aca716
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/more_let_tests2a.cpp
@@ -0,0 +1,126 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ /*
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = 0)[let(_b = _1)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ //int y = 0;
+ int x = (let(_a = 1)[let(_b = _a)[ _a ]])();
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ //int y = 0;
+ int x = (let(_a = 1)[let(_b = _a)[ _b ]])();
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ */
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ // Be very careful. Some of these cases give a silly answer
+ // with clang 3.4 with C++03 and work for C++11.
+ // gcc 4.8.2 seems O.K. both ways. Oh dear.
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P1A "; //clang - empty memory
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P1B "; //clang - 42 value- one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P2A "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ /* {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P2B "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 1;
+ int x = (let(_a = _1, _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P3 "; //clang - OK - one step better still
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a ]])(y);
+ // std::cout << x << " Q "; // clang 4201472
+ BOOST_TEST(x == 1);
+ }
+ */
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/more_let_tests2b.cpp b/src/boost/libs/phoenix/test/scope/more_let_tests2b.cpp
new file mode 100644
index 000000000..b6039f8f1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/more_let_tests2b.cpp
@@ -0,0 +1,136 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <cmath>
+#include <algorithm>
+#include <vector>
+
+#include <boost/phoenix/core/limits.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/scope.hpp>
+
+#include <typeinfo>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+int
+main()
+{
+ using boost::phoenix::let;
+ using boost::phoenix::val;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+ using boost::phoenix::local_names::_b;
+ /*
+ {
+ // show that we can return a local from an outer scope
+ int y = 0;
+ int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = 0)[let(_b = _1)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ //int y = 0;
+ int x = (let(_a = 1)[let(_b = _a)[ _a ]])();
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ //int y = 0;
+ int x = (let(_a = 1)[let(_b = _a)[ _b ]])();
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an outer scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _a ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ {
+ // show that we can return a local from an inner scope
+ int y = 1;
+ int x = (let(_a = _1)[let(_b = _a)[ _b ]])(y);
+
+ BOOST_TEST(x == 1);
+ }
+ */
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ // Be very careful. Some of these cases give a silly answer
+ // with clang 3.4 with C++03 and work for C++11.
+ // gcc 4.8.2 seems O.K. both ways. Oh dear.
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ /*{
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P1A "; //clang - empty memory
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P1B "; //clang - 42 value- one step better
+ BOOST_TEST(x == 1);
+ }
+ {
+ int y = 0;
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P2A "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+ }*/
+ {
+ int y = 0;
+#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 50000) && __OPTIMIZE__
+ //int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
+#else
+ int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
+ //std::cout << x << " P2B "; //clang - 42 value - one step better
+ BOOST_TEST(x == 1);
+#endif
+ }
+ {
+ int y = 1;
+ int x = (let(_a = _1, _b = val(2))[let(_b = _a)[ _a ]])(y);
+ //std::cout << x << " P3 "; //clang - OK - one step better still
+ BOOST_TEST(x == 1);
+ }
+
+ {
+ int y = 0;
+#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 50000) && __OPTIMIZE__
+ int z = 2;
+ int x = (let(_a = _1, _b = _2)[let(_b = _1)[ _a ]])(y,z);
+#else
+ int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a ]])(y);
+#endif
+ // std::cout << x << " Q "; // clang 4201472
+ BOOST_TEST(x == 1);
+ }
+
+
+ return boost::report_errors();
+}
+
diff --git a/src/boost/libs/phoenix/test/scope/this.cpp b/src/boost/libs/phoenix/test/scope/this.cpp
new file mode 100644
index 000000000..2f9ae578a
--- /dev/null
+++ b/src/boost/libs/phoenix/test/scope/this.cpp
@@ -0,0 +1,124 @@
+/*=============================================================================
+ Copyright (c) 2011 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/statement.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/scope.hpp>
+#include <iostream>
+#include <boost/phoenix/scope/this.hpp>
+
+
+template <typename T0>
+void f(T0 t)
+{
+ std::cout << t(1) << "\n";
+ std::cout << t(2) << "\n";
+ std::cout << t(3) << "\n";
+ std::cout << t(4) << "\n";
+ std::cout << t(5) << "\n";
+ std::cout << t(6) << "\n";
+ std::cout << t(7) << "\n";
+}
+
+template <typename T0>
+void f_2(T0 t)
+{
+ for(int i = 0; i < 10; ++i)
+ {
+ for(int j = 0; j < i; ++j)
+ {
+ std::cout << t(i, j) << " ";
+ }
+ std::cout << "\n";
+ }
+}
+
+int main()
+{
+ //using boost::phoenix::_this;
+ using boost::phoenix::if_;
+ using boost::phoenix::if_else;
+ using boost::phoenix::val;
+ using boost::phoenix::let;
+ using boost::phoenix::nothing;
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::arg_names::_2;
+ using boost::phoenix::local_names::_a;
+
+ f((
+ if_(_1 == 0)
+ [
+ std::cout << val("\n")
+ ]
+ .else_
+ [
+ std::cout << _1 << " "
+ , this_(_1 - 1)
+ ]
+ , val(0)
+ ));
+
+/*
+ f((
+ if_else(
+ _1 == 0
+ , _1
+ ,this_(_1 - 1)
+ )
+ ));
+*/
+
+ f((
+ if_else(
+ _1 != 0
+ ,this_(_1 - 1)
+ , _1
+ )
+ ));
+/*
+
+ f(( // fac(n) = n * fac(n-1); fac(1) = 1
+ if_else(
+ _1 <= 1
+ , 1
+ , _1 * _this(_1 - 1)
+ )
+ ));
+
+ f(( // fac(n) = n * fac(n-1); fac(1) = 1
+ if_else(
+ _1 > 1
+ , let(_a = _this(_1-1))[_1 * _a]
+ , 1
+ )
+ ));
+
+ f(( // fib(n) = fib(n-1) + fib(n-2); fib(0) = 0; fib(1) = 1
+ if_else(
+ _1 == 0
+ , 0
+ , if_else(
+ _1 == 1
+ , 1
+ , _this(_1 - 1) + _this(_1 - 2)
+ )
+ )
+ ));
+
+ f_2(( // bin(n, k) = bin(n-1, k-1) + bin(n-1, k); bin(n, 0) = 1; bin(0, k) = 0
+ if_else(
+ _1 == 0
+ , 0
+ , if_else(
+ _2 == 0
+ , 1
+ , _this(_1 - 1, _2 - 1) + _this(_1 - 1, _2)
+ )
+ )
+ ));
+*/
+}
diff --git a/src/boost/libs/phoenix/test/statement/bug5715.cpp b/src/boost/libs/phoenix/test/statement/bug5715.cpp
new file mode 100644
index 000000000..4e99d9286
--- /dev/null
+++ b/src/boost/libs/phoenix/test/statement/bug5715.cpp
@@ -0,0 +1,37 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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)
+==============================================================================*/
+
+// Check for Bug5715
+
+#include <boost/phoenix/statement/sequence.hpp>
+#include <boost/phoenix/bind.hpp>
+
+#include <boost/core/lightweight_test.hpp>
+
+namespace test
+{
+ int x = 0;
+ int y = 0;
+ int z = 0;
+
+ void f() { ++x; ++y; }
+ void g() { --x; ++z; }
+
+}
+int main()
+{
+ (
+ boost::phoenix::bind(test::f),
+ boost::phoenix::bind(test::g)
+ )();
+ BOOST_TEST(test::x == 0);
+ BOOST_TEST(test::y == 1);
+ BOOST_TEST(test::z == 1);
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/statement/exceptions.cpp b/src/boost/libs/phoenix/test/statement/exceptions.cpp
new file mode 100644
index 000000000..d2584f1d6
--- /dev/null
+++ b/src/boost/libs/phoenix/test/statement/exceptions.cpp
@@ -0,0 +1,194 @@
+/*=============================================================================
+ Copyright (c) 2005-2007 Dan Marsden
+ Copyright (c) 2005-2007 Joel de Guzman
+ Copyright (c) 2015 John Fletcher
+
+ 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 <stdexcept>
+#include <string>
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/statement.hpp>
+#include <boost/phoenix/scope/local_variable.hpp>
+#include <boost/phoenix/bind/bind_member_function.hpp>
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct base_exception : std::exception
+{
+ explicit
+ base_exception(char const *msg)
+ : _sliced(true), _what(msg)
+ {}
+
+ base_exception(base_exception const &other)
+ : _sliced(true), _what(other._what)
+ {
+ }
+
+ char const *what() const BOOST_NOEXCEPT_OR_NOTHROW
+ {
+ if (_sliced) { return "sliced ..."; }
+ return _what;
+ }
+
+ bool _sliced;
+ char const *_what;
+};
+
+struct extended_exception : base_exception
+{
+ explicit
+ extended_exception(char const *msg)
+ : base_exception(msg)
+ {
+ // mark as not sliced
+ _sliced = false;
+ }
+
+ extended_exception(extended_exception const &other)
+ : base_exception(other)
+ {
+ // mark as not sliced
+ _sliced = false;
+ }
+};
+
+int main()
+{
+ using boost::phoenix::throw_;
+ using boost::phoenix::try_;
+ using boost::phoenix::ref;
+ using boost::phoenix::local_names::_e;
+ using boost::phoenix::bind;
+ using std::exception;
+ using std::string;
+ using std::runtime_error;
+ namespace phx = boost::phoenix;
+
+ {
+ try
+ {
+ throw_(runtime_error("error"))();
+ BOOST_ERROR("exception should have been thrown");
+ }
+ catch(runtime_error& err)
+ {
+ BOOST_TEST(err.what() == string("error"));
+ }
+ }
+
+ {
+ try
+ {
+ try
+ {
+ throw runtime_error("error");
+ }
+ catch(exception&)
+ {
+ throw_()();
+ BOOST_ERROR("exception should have been rethrown");
+ }
+ }
+ catch(exception& err)
+ {
+ BOOST_TEST(err.what() == string("error"));
+ }
+ }
+
+ {
+ bool caught_exception = false;
+
+ try_
+ [ throw_(runtime_error("error")) ]
+ .catch_<exception>(_e) // captured but unused
+ [
+ ref(caught_exception) = true
+ ]();
+
+ BOOST_TEST(caught_exception);
+ }
+
+ {
+ bool caught_exception = false;
+ string what;
+
+ try_
+ [ throw_(runtime_error("error")) ]
+ .catch_<exception>(_e)
+ [
+ ref(caught_exception) = true
+ // ambiguous with std::ref
+ , phx::ref(what) = phx::bind(&exception::what, _e)
+ ]();
+
+ BOOST_TEST(caught_exception);
+ BOOST_TEST(what == string("error"));
+ }
+
+ {
+ bool caught_exception = false;
+ string what;
+
+ try_
+ [ throw_(extended_exception("error")) ]
+ .catch_<base_exception>(_e) // A thrown object should not be copied due to slicing.
+ [
+ ref(caught_exception) = true
+ // ambiguous with std::ref
+ , phx::ref(what) = phx::bind(&exception::what, _e)
+ ]();
+
+ BOOST_TEST(caught_exception);
+ BOOST_TEST(what == string("error"));
+ }
+
+ {
+ bool caught_exception = false;
+
+ try_
+ [ throw_(runtime_error("error")) ]
+ .catch_all
+ [ ref(caught_exception) = true ]();
+ BOOST_TEST(caught_exception);
+ }
+
+ {
+ bool caught_correct_exception = false;
+ string what;
+
+ try_
+ [ throw_(runtime_error("error")) ]
+ .catch_<string>()
+ [ ref(caught_correct_exception) = false ]
+ .catch_<exception>(_e)
+ [
+ ref(caught_correct_exception) = true
+ // ambiguous with std::ref
+ , phx::ref(what) = phx::bind(&exception::what, _e)
+ ]();
+
+ BOOST_TEST(caught_correct_exception);
+ BOOST_TEST(what == string("error"));
+ }
+
+ {
+ bool caught_correct_exception = false;
+
+ try_
+ [ throw_(runtime_error("error")) ]
+ .catch_<string>()
+ [ ref(caught_correct_exception) = false ]
+ .catch_all
+ [ ref(caught_correct_exception) = true]();
+
+ BOOST_TEST(caught_correct_exception);
+ }
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/statement/if_tests.cpp b/src/boost/libs/phoenix/test/statement/if_tests.cpp
new file mode 100644
index 000000000..1828a49df
--- /dev/null
+++ b/src/boost/libs/phoenix/test/statement/if_tests.cpp
@@ -0,0 +1,70 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/statement.hpp>
+#include <boost/phoenix/operator.hpp>
+
+int
+main()
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::if_;
+ using boost::phoenix::ref;
+
+ int init[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ std::vector<int> v(init, init+10);
+
+ std::cout << std::dec;
+ int x = 0;
+
+ for_each(v.begin(), v.end(),
+ if_(arg1 > 3 && arg1 <= 8)
+ [
+ std::cout << arg1 << ", ",
+ ref(x) += arg1
+ ]
+ );
+
+ std::cout << std::endl;
+ BOOST_TEST(x == 4+5+6+7+8);
+
+ x = 0;
+ int y = 0;
+ int z = 0;
+
+ for_each(v.begin(), v.end(),
+ if_(arg1 > 5)
+ [
+ std::cout << arg1 << " > 5\n",
+ ref(x) += arg1
+ ]
+ .else_
+ [
+ if_(arg1 == 5)
+ [
+ std::cout << arg1 << " == 5\n",
+ ref(z) += arg1
+ ]
+ .else_
+ [
+ std::cout << arg1 << " < 5\n",
+ ref(y) += arg1
+ ]
+ ]
+ );
+
+ std::cout << std::endl;
+ BOOST_TEST(x == 6+7+8+9+10);
+ BOOST_TEST(y == 1+2+3+4);
+ BOOST_TEST(z == 5);
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/statement/loops_tests.cpp b/src/boost/libs/phoenix/test/statement/loops_tests.cpp
new file mode 100644
index 000000000..f3f2743e1
--- /dev/null
+++ b/src/boost/libs/phoenix/test/statement/loops_tests.cpp
@@ -0,0 +1,85 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/statement.hpp>
+#include <boost/phoenix/operator.hpp>
+
+int
+main()
+{
+ using boost::phoenix::arg_names::arg1;
+ using boost::phoenix::do_;
+ using boost::phoenix::ref;
+ using boost::phoenix::val;
+
+ using std::cout;
+ using std::endl;
+ using std::for_each;
+ using std::vector;
+
+ int init[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ vector<int> v(init, init+10);
+ vector<int> t = v;
+ cout << endl;
+ int x = 0;
+
+ for_each(v.begin(), v.end(),
+ (
+ while_(arg1--)
+ [
+ cout << arg1 << ", ",
+ ++ref(x)
+ ],
+ cout << val("\n")
+ )
+ );
+
+ BOOST_TEST(x == 1+2+3+4+5+6+7+8+9+10);
+ cout << endl;
+ v = t;
+ x = 0;
+
+ for_each(v.begin(), v.end(),
+ (
+ do_
+ [
+ cout << arg1 << ", ",
+ ++ref(x)
+ ]
+ .while_(arg1--),
+ cout << val("\n")
+ )
+ );
+
+ BOOST_TEST(x == 2+3+4+5+6+7+8+9+10+11);
+ cout << endl;
+ v = t;
+ x = 0;
+
+ int iii;
+ for_each(v.begin(), v.end(),
+ (
+ for_(ref(iii) = 0, ref(iii) < arg1, ++ref(iii))
+ [
+ cout << arg1 << ", ",
+ ++ref(x)
+ ],
+ cout << val("\n")
+ )
+ );
+
+ BOOST_TEST(x == 1+2+3+4+5+6+7+8+9+10);
+ cout << endl;
+ v = t;
+ x = 0;
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/statement/switch_tests.cpp b/src/boost/libs/phoenix/test/statement/switch_tests.cpp
new file mode 100644
index 000000000..d72479829
--- /dev/null
+++ b/src/boost/libs/phoenix/test/statement/switch_tests.cpp
@@ -0,0 +1,76 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/statement.hpp>
+#include <boost/phoenix/operator.hpp>
+
+int
+main()
+{
+ using boost::phoenix::arg_names::_1;
+ using boost::phoenix::case_;
+ using boost::phoenix::switch_;
+ using boost::phoenix::ref;
+ using boost::phoenix::val;
+
+ using std::cout;
+ using std::endl;
+ using std::vector;
+ using std::for_each;
+
+ int init[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ vector<int> v(init, init+10);
+
+ for_each(v.begin(), v.end(),
+ switch_(_1)
+ [
+ // wierd case, why not just use if(...), but valid, nonetheless
+ case_<4>(cout << val("<4>") << endl)
+ ]
+ );
+
+ cout << endl;
+ for_each(v.begin(), v.end(),
+ switch_(_1)
+ [
+ // wierd case, but valid, nonetheless
+ default_(cout << val("<any...>") << endl)
+ ]
+ );
+
+ cout << endl;
+
+ for_each(v.begin(), v.end(),
+ switch_(_1)
+ [
+ case_<1>(cout << val("<1>") << endl),
+ case_<2>(cout << val("<2>") << endl),
+ case_<3>(cout << val("<3>") << endl),
+ case_<4>(cout << val("<4>") << endl)
+ ]
+ );
+
+ cout << endl;
+
+ for_each(v.begin(), v.end(),
+ switch_(_1)
+ [
+ case_<1>(cout << val("<1>") << endl),
+ case_<2>(cout << val("<2>") << endl),
+ case_<3>(cout << val("<3>") << endl),
+ case_<4>(cout << val("<4>") << endl),
+ default_(cout << val("<over 4>") << endl)
+ ]
+ );
+
+ return boost::report_errors();
+}
diff --git a/src/boost/libs/phoenix/test/stdlib/cmath.cpp b/src/boost/libs/phoenix/test/stdlib/cmath.cpp
new file mode 100644
index 000000000..f4703c61d
--- /dev/null
+++ b/src/boost/libs/phoenix/test/stdlib/cmath.cpp
@@ -0,0 +1,31 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+ Copyright (c) 2014 John Fletcher
+
+ 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 <cmath>
+#include <boost/function.hpp>
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/phoenix/stl/cmath.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ double eps = 0.000001;
+ using namespace boost::phoenix::arg_names;
+ boost::function<bool(double, double)> f = boost::phoenix::fabs(_1 - _2) < eps;
+
+ double x = boost::phoenix::pow(_1,_2)(2.,2.);
+ double y = boost::phoenix::atan2(_1,_2)(1.,1.);
+ double z = boost::phoenix::tan(_1)(y);
+
+ BOOST_TEST(f(0.0, 0 * eps));
+ BOOST_TEST(!f(0.0, eps));
+ BOOST_TEST(std::fabs(x-4.) < eps );
+ BOOST_TEST(std::fabs(z-1.) < eps );
+ return boost::report_errors();
+}