2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

update to defaults gen that fixes member functions with zero arguments (added a test in defaults.cpp)

[SVN r15162]
This commit is contained in:
Joel de Guzman
2002-09-04 22:36:05 +00:00
parent d274a8395b
commit 4d53fb97b6
2 changed files with 10 additions and 1 deletions

View File

@@ -108,7 +108,8 @@ struct func_stubs_base {};
#define BPL_IMPL_MEM_FUNC_WRAPPER_GEN(INDEX, DATA) \
static RT BOOST_PP_CAT(func_, INDEX) \
( \
ClassT& obj, \
ClassT& obj BOOST_PP_COMMA_IF( \
BOOST_PP_ADD(BOOST_PP_TUPLE_ELEM(3, 1, DATA), INDEX)) \
BOOST_PP_ENUM \
( \
BOOST_PP_ADD(BOOST_PP_TUPLE_ELEM(3, 1, DATA), INDEX), \

View File

@@ -83,6 +83,13 @@ struct X {
return format % make_tuple(a, b, c, d);
}
object
bar2(int a = 0, char b = 'D', std::string c = "default", double d = 0.0) const
{
// tests zero arg member function
return format % make_tuple(a, b, c, d);
}
object
foo(int a, bool b=false) const
{
@@ -111,6 +118,7 @@ struct X {
};
BOOST_PYTHON_MEM_FUN_GENERATOR(X_bar_stubs, bar, 1, 4)
BOOST_PYTHON_MEM_FUN_GENERATOR(X_bar2_stubs, bar2, 0, 4) // tests zero arg member function
BOOST_PYTHON_MEM_FUN_GENERATOR(X_foo_2_stubs, foo, 1, 2)
BOOST_PYTHON_MEM_FUN_GENERATOR(X_foo_3_stubs, foo, 2, 3)