[C++-sig] Re: injected constructors
Gideon May
gideon at computer.org
Sun Sep 21 20:01:45 CEST 2003
Dave,
--On Sunday, September 21, 2003 11:18 AM -0400 David Abrahams
<dave at boost-consulting.com> wrote:
> The code snippet is missing the definitions of classes, etc. Can't
> you produce a minimal test case? I don't even see make_constructor
> in here.
I just realized that I compiled with warning level 3. The warning doesn't
show up with the default warning level. I've created a simple (contrived)
test case which
shows the warning :
-----------------------------------------------
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/python/return_internal_reference.hpp>
#include <boost/python/class.hpp>
using namespace boost::python;
struct Vec3
{
};
struct Bound
{
Vec3& getVec() { return _vec; }
protected:
Vec3 _vec;
};
BOOST_PYTHON_MODULE(test_internal_reference)
{
class_<Vec3>("Vec3");
class_<Bound>("Bound")
.def("getVec", &Bound::getVec, return_internal_reference<>())
;
}
#include "module_tail.cpp"
---------------------------------------------------------
This is the entry in the test/Jamfile :
--------------------------------------------------------
bpl-test internal_reference
:
:
<vc7><release><cxxflags>"-W3 -EHa"
;
--------------------------------------------------------
Ciao,
Gideon
More information about the Cplusplus-sig
mailing list