Skip to content

Commit 06f6f2f

Browse files
committed
Restore main trunk to health
[SVN r15359]
1 parent b371981 commit 06f6f2f

20 files changed

+56
-49
lines changed

test/back_reference.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ BOOST_PYTHON_MODULE_INIT(back_reference_ext)
9393
def("copy_Z", copy_Z, return_value_policy<copy_const_reference>());
9494
def("x_instances", &X::count);
9595

96-
class_<Y>("Y", init<int>())
96+
class_<Y>("Y", args<int>())
9797
.def("value", &Y::value)
9898
.def("set", &Y::set)
9999
;
100100

101-
class_<Z,std::auto_ptr<Z> >("Z", init<int>())
101+
class_<Z,std::auto_ptr<Z> >("Z", args<int>())
102102
.def("value", &Z::value)
103103
.def("set", &Z::set)
104104
;

test/bienstman3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ BOOST_PYTHON_MODULE_INIT(bienstman3_ext)
1717
using namespace boost::python;
1818

1919
class_<V, boost::noncopyable>("V", no_init);
20-
class_<B>("B", init<const V&>());
20+
class_<B>("B", args<const V&>());
2121

2222
}

test/bienstman4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ BOOST_PYTHON_MODULE_INIT(bienstman4_ext)
3030
class_<Type1>("T1")
3131
;
3232

33-
class_<Term>("Term", init<Type1&>())
33+
class_<Term>("Term", args<Type1&>())
3434
;
3535

3636
Type1 t1;

test/bienstman5.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BOOST_PYTHON_MODULE_INIT(bienstman5_ext)
1717
{
1818
using namespace boost::python;
1919

20-
class_<M>("M", init<std::complex<double> const&>())
20+
class_<M>("M", args<std::complex<double> const&>())
2121
;
2222
}
2323

test/callbacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ BOOST_PYTHON_MODULE_INIT(callbacks_ext)
137137
def("apply_to_string_literal", apply_to_string_literal);
138138

139139

140-
class_<X>("X", init<int>())
141-
.def(init<X const&>())
140+
class_<X>("X", args<int>())
141+
.def_init(args<X const&>())
142142
.def("value", &X::value)
143143
.def("set", &X::set)
144144
;

test/data_members.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ double get_fair_value(X const& x) { return x.value(); }
2222

2323
BOOST_PYTHON_MODULE_INIT(data_members_ext)
2424
{
25-
class_<X>("X", init<int>())
25+
class_<X>("X", args<int>())
2626
.def("value", &X::value)
2727
.def("set", &X::set)
2828
.def_readonly("x", &X::x)
2929
.add_property("fair_value", &get_fair_value)
3030
;
3131

32-
class_<Y>("Y", init<int>())
32+
class_<Y>("Y", args<int>())
3333
.def("value", &Y::value)
3434
.def("set", &Y::set)
3535
.def_readwrite("x", &Y::x)

test/defaults.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,25 @@ BOOST_PYTHON_MODULE_INIT(defaults_ext)
158158
.def("barfoo", (object(*)(int, char, std::string, double))0, bar_stubs())
159159
;
160160

161-
class_<Y>("Y", init<>("doc of Y init")) // this should work
161+
class_<Y>("Y", no_init)
162162
.def("get_state", &Y::get_state)
163163
;
164164

165165
class_<X>("X")
166166

167-
.def(init<int, optional<char, std::string, double> >("doc of init"))
168-
.def(init<std::string, bool>()[default_call_policies()]) // what's a good policy here?
167+
# if (!defined(BOOST_INTEL_CXX_VERSION) || BOOST_INTEL_CXX_VERSION > 600)
168+
.def(init<int, optional<char, std::string, double> >())
169+
.def(init<std::string, bool>())
170+
# else
171+
.def_init(args<int>())
172+
.def_init(args<int, char>())
173+
.def_init(args<int, char, std::string>())
174+
.def_init(args<int, char, std::string, double>())
175+
.def_init(args<std::string, bool>())
176+
# endif
169177
.def("get_state", &X::get_state)
170178
.def("bar", &X::bar, X_bar_stubs())
171-
.def("bar2", &X::bar2, X_bar_stubs2("doc of X::bar2")[return_internal_reference<>()])
179+
.def("bar2", &X::bar2, X_bar_stubs2(), return_internal_reference<>())
172180
.def("foo", (object(X::*)(std::string, bool) const)0, X_foo_2_stubs())
173181
.def("foo", (object(X::*)(int, bool) const)0, X_foo_2_stubs())
174182
.def("foo", (object(X::*)(list, list, bool) const)0, X_foo_3_stubs())

test/docstring.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,23 @@ BOOST_PYTHON_MODULE_INIT(docstring_ext)
3636
"A simple test module for documentation strings\n"
3737
"Exercised by docstring.py"
3838
;
39-
39+
4040
class_<X>("X",
4141
"A simple class wrapper around a C++ int\n"
4242
"includes some error-checking"
43-
44-
, init<int>(
45-
"this is the __init__ function\n"
46-
"its documentation has two lines."
47-
)
43+
44+
, args<int>(),
45+
"this is the __init__ function\n"
46+
"its documentation has two lines."
4847

4948
)
5049
.def("value", &X::value,
5150
"gets the value of the object")
5251
;
53-
52+
5453
def("create", create, return_value_policy<manage_new_object>(),
5554
"creates a new X object");
56-
55+
5756
def("fact", fact, "compute the factorial");
5857
}
5958

test/extract.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ BOOST_PYTHON_MODULE_INIT(extract_ext)
124124
;
125125

126126
object x_class(
127-
class_<X>("X", init<int>())
127+
class_<X>("X", args<int>())
128128
.def( "__repr__", x_rep));
129129

130130
// Instantiate an X object through the Python interface

test/implicit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ BOOST_PYTHON_MODULE_INIT(implicit_ext)
2727
def("x_value", x_value);
2828
def("make_x", make_x);
2929

30-
class_<X>("X", init<int>())
30+
class_<X>("X", args<int>())
3131
.def("value", &X::value)
3232
.def("set", &X::set)
3333
;

0 commit comments

Comments
 (0)