@ananas Well, if I have to autogenerate, I could do this instead:
template <class T>
void work_on_paydirt (T *ambi_object) {
struct bar *object = ambi_object->gimme_bar();
printf("Teh paydirt is %i\n", object->paydirt);
}
Slightly less bulky, but it looks ugly.