From 9b9851a887d54488fd41a356e3cbeea9cdeb9d62 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 4 Jan 2024 20:26:54 +0200 Subject: [PATCH 1/4] Add bind_over_test.cpp --- test/Jamfile.v2 | 1 + test/bind_over_test.cpp | 86 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 test/bind_over_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 31258515..abb1d4b8 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -83,3 +83,4 @@ run apply_test.cpp ; run apply_test2.cpp ; run apply_rv_test.cpp ; run apply_rv_test2.cpp ; +run bind_over_test.cpp ; diff --git a/test/bind_over_test.cpp b/test/bind_over_test.cpp new file mode 100644 index 00000000..26fce267 --- /dev/null +++ b/test/bind_over_test.cpp @@ -0,0 +1,86 @@ +// +// bind_over_test.cpp - overloaded functions +// +// Copyright 2017, 2024 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 +#include + +using namespace boost::placeholders; + +// + +int f() +{ + return 17041; +} + +int f( int x1 ) +{ + return x1; +} + +int f( int x1, int x2 ) +{ + return x1+x2; +} + +int f( int x1, int x2, int x3 ) +{ + return x1+x2+x3; +} + +int f( int x1, int x2, int x3, int x4 ) +{ + return x1+x2+x3+x4; +} + +int f( int x1, int x2, int x3, int x4, int x5 ) +{ + return x1+x2+x3+x4+x5; +} + +int f( int x1, int x2, int x3, int x4, int x5, int x6 ) +{ + return x1+x2+x3+x4+x5+x6; +} + +int f( int x1, int x2, int x3, int x4, int x5, int x6, int x7 ) +{ + return x1+x2+x3+x4+x5+x6+x7; +} + +int f( 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 f( 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; +} + +void overloaded_function_test() +{ + BOOST_TEST_EQ( boost::bind( f )(), 17041 ); + BOOST_TEST_EQ( boost::bind( f, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + BOOST_TEST_EQ( boost::bind( f, 1, 2, 3, 4, 5, 6, 7, 8, 9 )(), 1+2+3+4+5+6+7+8+9 ); +} + +int main() +{ + overloaded_function_test(); + return boost::report_errors(); +} From 1d123d64320eb39b3871b7b2160b8fbc2221dd39 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 4 Jan 2024 20:36:39 +0200 Subject: [PATCH 2/4] Add bind_over_mf_test.cpp --- test/Jamfile.v2 | 1 + test/bind_over_mf_test.cpp | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 test/bind_over_mf_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index abb1d4b8..b38f5fbc 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -84,3 +84,4 @@ run apply_test2.cpp ; run apply_rv_test.cpp ; run apply_rv_test2.cpp ; run bind_over_test.cpp ; +run bind_over_mf_test.cpp ; diff --git a/test/bind_over_mf_test.cpp b/test/bind_over_mf_test.cpp new file mode 100644 index 00000000..ebb7cc1a --- /dev/null +++ b/test/bind_over_mf_test.cpp @@ -0,0 +1,72 @@ +// +// bind_over_mf_test.cpp - overloaded member functions +// +// Copyright 2017, 2024 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 +#include + +// + +struct X +{ + int f() { return 17041; } + int f( int x1 ) { return x1; } + int f( int x1, int x2 ) { return x1+x2; } + int f( int x1, int x2, int x3 ) { return x1+x2+x3; } + int f( int x1, int x2, int x3, int x4 ) { return x1+x2+x3+x4; } + int f( int x1, int x2, int x3, int x4, int x5 ) { return x1+x2+x3+x4+x5; } + int f( int x1, int x2, int x3, int x4, int x5, int x6 ) { return x1+x2+x3+x4+x5+x6; } + int f( int x1, int x2, int x3, int x4, int x5, int x6, int x7 ) { return x1+x2+x3+x4+x5+x6+x7; } + int f( 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 f( 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 g() const { return 17041; } + int g( int x1 ) const { return x1; } + int g( int x1, int x2 ) const { return x1+x2; } + int g( int x1, int x2, int x3 ) const { return x1+x2+x3; } + int g( int x1, int x2, int x3, int x4 ) const { return x1+x2+x3+x4; } + int g( int x1, int x2, int x3, int x4, int x5 ) const { return x1+x2+x3+x4+x5; } + int g( int x1, int x2, int x3, int x4, int x5, int x6 ) const { return x1+x2+x3+x4+x5+x6; } + int g( int x1, int x2, int x3, int x4, int x5, int x6, int x7 ) const { return x1+x2+x3+x4+x5+x6+x7; } + int g( 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 g( 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; } +}; + +void overloaded_member_function_test() +{ + X x; + + BOOST_TEST_EQ( boost::bind( &X::f, &x )(), 17041 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + X const* pcx = &x; + + BOOST_TEST_EQ( boost::bind( &X::g, pcx )(), 17041 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); +} + +int main() +{ + overloaded_member_function_test(); + return boost::report_errors(); +} From 6926dbfc5197ce20b49f8ffb96648b919bc07e9f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 4 Jan 2024 20:49:06 +0200 Subject: [PATCH 3/4] Expand bind_over_mf_test.cpp --- test/bind_over_mf_test.cpp | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/bind_over_mf_test.cpp b/test/bind_over_mf_test.cpp index ebb7cc1a..7278df52 100644 --- a/test/bind_over_mf_test.cpp +++ b/test/bind_over_mf_test.cpp @@ -52,6 +52,26 @@ void overloaded_member_function_test() BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x )(), 17041 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + BOOST_TEST_EQ( boost::bind( &X::f, &x )(), 17041 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( &X::f, &x, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + X const* pcx = &x; BOOST_TEST_EQ( boost::bind( &X::g, pcx )(), 17041 ); @@ -63,6 +83,26 @@ void overloaded_member_function_test() BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + BOOST_TEST_EQ( boost::bind( &X::g, pcx )(), 17041 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + BOOST_TEST_EQ( boost::bind( &X::g, pcx )(), 17041 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( &X::g, pcx, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); } int main() From 74308ee22336c0807a78c99e357b1f9f94758d9e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 4 Jan 2024 20:56:32 +0200 Subject: [PATCH 4/4] Add bind_over_mf2_test.cpp --- test/Jamfile.v2 | 1 + test/bind_over_mf2_test.cpp | 93 +++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 test/bind_over_mf2_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index b38f5fbc..80980d76 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -85,3 +85,4 @@ run apply_rv_test.cpp ; run apply_rv_test2.cpp ; run bind_over_test.cpp ; run bind_over_mf_test.cpp ; +run bind_over_mf2_test.cpp ; diff --git a/test/bind_over_mf2_test.cpp b/test/bind_over_mf2_test.cpp new file mode 100644 index 00000000..9c341050 --- /dev/null +++ b/test/bind_over_mf2_test.cpp @@ -0,0 +1,93 @@ +// +// bind_over_mf2_test.cpp - overloaded member functions, type<> syntax +// +// Copyright 2017, 2024 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 +#include +#include + +// + +struct X +{ + int f() { return 17041; } + int f( int x1 ) { return x1; } + int f( int x1, int x2 ) { return x1+x2; } + int f( int x1, int x2, int x3 ) { return x1+x2+x3; } + int f( int x1, int x2, int x3, int x4 ) { return x1+x2+x3+x4; } + int f( int x1, int x2, int x3, int x4, int x5 ) { return x1+x2+x3+x4+x5; } + int f( int x1, int x2, int x3, int x4, int x5, int x6 ) { return x1+x2+x3+x4+x5+x6; } + int f( int x1, int x2, int x3, int x4, int x5, int x6, int x7 ) { return x1+x2+x3+x4+x5+x6+x7; } + int f( 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 f( 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 g() const { return 17041; } + int g( int x1 ) const { return x1; } + int g( int x1, int x2 ) const { return x1+x2; } + int g( int x1, int x2, int x3 ) const { return x1+x2+x3; } + int g( int x1, int x2, int x3, int x4 ) const { return x1+x2+x3+x4; } + int g( int x1, int x2, int x3, int x4, int x5 ) const { return x1+x2+x3+x4+x5; } + int g( int x1, int x2, int x3, int x4, int x5, int x6 ) const { return x1+x2+x3+x4+x5+x6; } + int g( int x1, int x2, int x3, int x4, int x5, int x6, int x7 ) const { return x1+x2+x3+x4+x5+x6+x7; } + int g( 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 g( 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; } +}; + +void overloaded_member_function_test() +{ + X x; + + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x )(), 17041 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x )(), 17041 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::f, &x, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + X const* pcx = &x; + + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx )(), 17041 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); + + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx )(), 17041 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1 )(), 1 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2 )(), 1+2 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3 )(), 1+2+3 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4 )(), 1+2+3+4 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5 )(), 1+2+3+4+5 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5, 6 )(), 1+2+3+4+5+6 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5, 6, 7 )(), 1+2+3+4+5+6+7 ); + BOOST_TEST_EQ( boost::bind( boost::type(), &X::g, pcx, 1, 2, 3, 4, 5, 6, 7, 8 )(), 1+2+3+4+5+6+7+8 ); +} + +int main() +{ + overloaded_member_function_test(); + return boost::report_errors(); +}