[gambit-list] Creating a c-define-type using c++ reference

Ivan Kelly ivan at bleurgh.com
Sun Aug 23 07:21:57 EDT 2009


Im porting a C++ library to gambit and have numerous functions which
take references as parameters or return type.

(define QObject-setObjectName
       (c-lambda (QObject* const_QString&) (void)
        "arg1->setObjectName(arg2);"))

(define QObject-children
       (c-lambda (QObject*) (const_QList<QObject*>&)
        "____result = arg1->children();"))

My problem is I don't know how to c-define-type the reference
types. On the one hand I want them to act as "type", when being passed
in as parameters. On the other I want pointer behaviour, so that the
whole object isn't copied on return. Has anyone else run into this
problem with c++, and how did you solve it?

Regards
Ivan



More information about the Gambit-list mailing list