Skip to content

Commit 4f129d0

Browse files
committed
Bug fix, thanks to Nicolas LELONG, nlelong-at-mgdesign.org for the report.
[SVN r20401]
1 parent 7a354c4 commit 4f129d0

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

include/boost/python/object_core.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ namespace api
280280
return object_initializer<
281281
BOOST_DEDUCED_TYPENAME unwrap_reference<T>::type
282282
>::get(
283-
api::do_unforward_cref(x)
283+
x
284284
, is_obj()
285285
);
286286
}

test/object.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@
66
#include <boost/python/module.hpp>
77
#include <boost/python/def.hpp>
88
#include <boost/python/object.hpp>
9+
#include <boost/python/class.hpp>
910

1011
using namespace boost::python;
1112

13+
class NotCopyable
14+
{
15+
} not_copyable;
16+
17+
object ref_to_noncopyable()
18+
{
19+
return object(boost::ref(not_copyable));
20+
}
21+
1222
object call_object_3(object f)
1323
{
1424
return f(3);
@@ -281,6 +291,9 @@ bool check_inplace(object l, object o)
281291

282292
BOOST_PYTHON_MODULE(object_ext)
283293
{
294+
class_<NotCopyable, boost::noncopyable>("NotCopyable", no_init);
295+
296+
def("ref_to_noncopyable", ref_to_noncopyable);
284297
def("call_object_3", call_object_3);
285298
def("message", message);
286299
def("number", number);

test/object.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'''
22
>>> from object_ext import *
3+
4+
>>> class(ref_to_noncopyable())
5+
object_ext.NotCopyable
6+
37
>>> def print1(x):
48
... print x
59
>>> call_object_3(print1)

0 commit comments

Comments
 (0)