Boost logo

Boost :

From: Brad King (brad.king_at_[hidden])
Date: 2002-08-13 13:43:33


Dave,

> What I'd like is to be able to generate a compiler warning or error if
> the user fails to call the def_init() member function somewhere in the
> chain. Any ideas?

What if the class really doesn't have any public constructors?

A* get_A();

class A
{
  A() {}
  friend A* get_A();
public:
  void method();
};

...

module("my_module")
  .add(class_<A>("A").def("method", &A::method))
  .def("get_A", get_A, return_value_policy<manage_new_object>());

-Brad


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