March 13, 2005
12:21 a.m.
"Leonard \"paniq\" Ritter" <paniq@paniq.org> writes:
followup (heh):
to get the syntax i wished for i wrote a function that went like
template<typename T> Ptr<T> New(const String& objectClassName) { return Ptr<T>(objectClassName); }
and exposed it via def("View",New<View>), and that works due to boost.pythons magical ptr conversion wizardry ;) the class itself is now exposed as "ViewInterface" which is not _perfect_, but its sufficient since type names dont play a big role in python anyway.
Okay, but you could use make_constructor; it will get you the interface you want.
thank you dave for the help, boost.python rocks again :)
Sure. -- Dave Abrahams Boost Consulting www.boost-consulting.com