On 9/11/18 9:47 AM, Russel Winder wrote:

I think I feel ambivalent about the get template idea, it moves things from being GIR driven to being manual binding. Unless I am missing something.

There is a trade off between minimizing manually added code and usability.

In this case first we the user no longer needs to know if the class they
want to use is stored as a object, a boxed type or a pointer.

And for boxed and pointer options the getBoxed and getPointer functions
return a pointer to the C struct and not the D class. Where you need to
instantiate the D class from the C pointer.

Luckily the getObject function already returns a ObjectG so the
boilerplate to handle the reference count correctly isn't needed.