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:
@@ -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), \
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user