Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2006-11-03 11:09:36


Bugs item #1590010, was opened at 2006-11-03 17:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1590010&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python
Group: release 1.34.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Joachim Falk (jfalk)
Assigned to: David Abrahams (david_abrahams)
Summary: static assert for boost::python::make_constructor

Initial Comment:
You get a static assertion when using
boost::python::make_constructor together
with the call policy
return_value_policy<manage_new_object>()

Test case:
=====================================================
#include <boost/python.hpp>

namespace Test {
  using namespace boost::python;

  class Foo {
  };

  Foo *fooCreator() { return new Foo(); }

  BOOST_PYTHON_MODULE(Test)
  {
    class_<Foo>("Foo")
      .def("__init__", make_constructor(fooCreator,
return_value_policy<manage_new_object>()));
  }

} /* namespace Test */

Failure:
=====================================================
/usr/include/boost/python/make_constructor.hpp: In
instantiation of
`boost::python::detail::constructor_policy<boost::python::return_value_policy<boost::python::manage_new_object,
boost::python::default_call_policies> >':
/usr/include/boost/python/make_constructor.hpp:150:
instantiated from `boost::python::api::object
boost::python::detail::make_constructor_aux(F, const
CallPolicies&, const Sig&) [with F = Test::Foo*(*)(),
CallPolicies =
boost::python::return_value_policy<boost::python::manage_new_object,
boost::python::default_call_policies>, Sig =
boost::mpl::vector1<Test::Foo*>]'
/usr/include/boost/python/make_constructor.hpp:236:
instantiated from `boost::python::api::object
boost::python::make_constructor(F, const CallPolicies&)
[with F = Test::Foo*(*)(), CallPolicies =
boost::python::return_value_policy<boost::python::manage_new_object,
boost::python::default_call_policies>]'
boost-python-test.cpp:14: instantiated from here
/usr/include/boost/python/make_constructor.hpp:106:
error: incomplete type `
   boost::STATIC_ASSERTION_FAILURE<false>' does not
have member `value'

Expected Result:
=====================================================
Should compile

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1590010&group_id=7586

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk