but the above untested example won't work.
Oh... bugger... well... it seemed a good idea at the time.
FYI :-)
Some "real" code snippets, from my DateTime module (wrapping the C++ Boost libs):
.. creating a new instance of a C++ class ..
time_duration * bmx_time_duration(int hours, int minutes, int seconds, int fraction) { return new time_duration(hours, minutes, seconds, fraction); }
... using that instance ...
int bmx_time_duration_hours(time_duration * d) { return d->hours(); }
Which part of that won't work?