$ grep NRObject /Volumes/Ben/PROG/SF/INKSCAPE/inkscape-P/src/libnr/nr-object.h struct NRObject; struct NRObjectClass; #define NR_OBJECT(o) (NR_CHECK_INSTANCE_CAST ((o), NR_TYPE_OBJECT, NRObject)) #define NR_OBJECT_GET_CLASS(ip) (((NRObject *) ip)->klass) void (* cinit) (NRObjectClass *), void (* iinit) (NRObject *)); /* NRObject */ class NRObject : public Inkscape::GC::Managed<>, NRObjectClass *klass; static NRObject *alloc(NRType type); static void invoke_ctor(NRObject *object) { NRObject *reference() { NRObject *unreference() { NRObject() {} NRObject(NRObject const &); // no copy void operator=(NRObject const &); // no assign struct NRObjectClass { ...
I'm fairly sure that it doesn't matter, but I just wondered whether we should stick to one or the other. I work on the basis that a C++ struct has all members public, but can have methods and virtual methods if needed or desirable; even so, I tend not to use that keyword except for C compatibility, that is when there are in fact no methods in the class, and I would guess no vptr either.
See http://www.parashift.com/c++-faq-lite/classes-and-objects.html#faq-7.8 http://groups.google.co.uk/group/comp.lang.c++/browse_thread/thread/20f6e046...