On Mon, 16 Nov 2009 18:58:42 +0300, Frank Benoit <[email protected]> wrote:

Reminds me of an older thread:
http://www.digitalmars.com/d/archives/digitalmars/D/Implicit_castable_structs_64764.html

I recall it, but I still think "alias this" is the way to go:

struct GtkWidget{ /* data member */ }

struct GtkContainer{
    GtkWidget widget; // mixin GtkWidget; could also work, though
    // more data members

    alias this &widget; // how would you do the same without a named mixin?
    // And what's the benefit of named mixin over plain old aggregation?
}

Reply via email to