C++ wrap C struct *and* and functions
I'm trying to wrap a C library which uses patterns like this:

    Thing* x= new_thing_("blah");
    Thing* tmp= thing_copy(x);
    free_thing(tmp);
    Other* y=get_other(x,7);
    char* message=get_message(x,y);
    free_thing(x);
    free_other(y);

In c++, I'd like to be able to do something like

    auto_ptr<CXXThing> x=new CXXThing("blah");
    auto_ptr<CXXThing> tmp=new CXXThing(*x);
    auto_ptr<CXXOther> y=x->get_other(7);
    char* message = y->get_message();

Obviously, CXXOther wraps a pointer to a CXXThing as well.  So the problem I'm encountering is that essentially I'd like to just "insert" functions and members into existing structs (I think this is known as the "Mixin" idea).

The problem is that if I include a Thing as an element of the CXXThing, then I don't know how I'd declare the constructor, and if I include a *pointer* to the wrapped class, then I have an extra level of useless indirection.

How should I wrap it so that this is possible?  (An answer of "What you want to do is not best/possible... here is the proper way" is also acceptable.)
C++ wrap C struct *and* and functions
===

I'm trying to wrap a C library which uses patterns like this:

    Thing* x= new_thing_("blah");
    Thing* tmp= thing_copy(x);
    free_thing(tmp);
    Other* y=get_other(x,7);
    char* message=get_message(x,y);
    free_thing(x);
    free_other(y);

In c++, I'd like to be able to do something like

    auto_ptr<CXXThing> x=new CXXThing("blah");
    auto_ptr<CXXThing> tmp=new CXXThing(*x);
    auto_ptr<CXXOther> y=x->get_other(7);
    char* message = y->get_message();

Obviously, CXXOther wraps a pointer to a CXXThing as well.  So the problem I'm encountering is that essentially I'd like to just "insert" functions and members into existing structs (I think this is known as the "Mixin" idea).

The problem is that if I include a Thing as an element of the CXXThing, then I don't know how I'd declare the constructor, and if I include a *pointer* to the wrapped class, then I have an extra level of useless indirection.

How should I wrap it so that this is possible?  (An answer of "What you want to do is not best/possible... here is the proper way" is also acceptable.)