lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> For python there are two templated library: CXX and Boost.
> They are using similar tecniques as yours (IMHO).
> Some code ragments from CXX examples:
> // Making an extension object
> class r: public Py::PythonExtension<r> {
> ...
>     // override functions from PythonExtension
>     virtual Py::Object repr();
>     virtual Py::Object getattr( const char *name );
> ...
> class R: public Py::SeqBase<Py::Int> {
> ...
>     Py::Object value(const Py::Tuple& t) const {
>         return static_cast<r *>(ptr())->c_value(t);
> ...
> Good luck!

Actually, yesterday I worked out the problem with VC++: for some reason
it doesn't like member (method) templates. So I've converted them to
nested template classes that encapsulate the appropriate methods. And it
works! I'll soon upload it again, and probably I'll run it against the
borland compiler as well now that I've got the free version.