need help with member const pointer conversion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

need help with member const pointer conversion

Tony Kostanjsek

I'm working on a binding for Box2D 2.1.2 and stumbled across this:

struct b2FixtureDef
const b2Shape* shape

class b2Shape { .... };
class b2PolygonShape : public b2Shape { ... };

I can bind b2Fixture and b2Shape and create both, but when I try to assign a
shape to the fixture member, luabind complains. Here's the code from the
Tutorial ported to Lua:

  dynamicBox = box2d.b2PolygonShape()
  fixtureDef = box2d.b2FixtureDef()
  fixtureDef.shape = dynamicBox

The last line produces the following error:

  No matching overload found, candidates:
  void <unknown>(b2FixtureDef&,b2Shape const* const&)

Wrapping it in a setter works:

  void shape_setter(b2FixtureDef* fd, b2Shape* sh)
    fd->shape = sh;

but I'm puzzled why luabind won't allow me to assign a Shape* to a const Shape*
Any help appreciated,

p.s. Mac, gcc 4.2.1, boost 1.44, luabind 0.9.1

Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
luabind-user mailing list
[hidden email]