Simple class shadowing test.  Only partially works, but the
results look promising to me.

To build: run SWIG with the -c++ and -d options.

    swig -c++ -d example.i

This will create three files: example.d, example_extern.d, and example_wrap.cpp

    example_wrap.cpp contains a bunch of extern "C" functions which provide the
    C interface that D needs.

    example_extern.d is a bunch of extern(C) declarations that match these.

    example.d is a set of wrapper classes that attempts to reflect the original
    C++ as closely as is reasonably possible.

Building is easy:

    First, build the C++:

        Since example.cxx and example.d have the same name, we need to prevent
        the .OBJ files from colliding.

        dmc -oexample_cpp.obj example.cxx
        dmc -c example_wrap.cpp

    Build main.d and example.d and link

        dmd -oftest.exe main.d example.d example_cpp.obj example_wrap.obj

    viola!

Limitations

    You can't extend C++ classes.

    C++ exceptions are not caught and translated to D.

    Namespaces, templates, and some other things haven't yet been tested
    thoroughly.

    (these could be lifted in the future, of course)

Typemaps:

    Most of the builtin typelists that SWIG uses should work normally.

    The D backend also uses a few typemaps to parameterize the generated code:

        CtoExtern       -       Maps a type to an extern "C"-friendly type.
        CtoD            -       Maps a type to its D equivalent
        DtoC            -       Maps a D type to its C equivalent.

    %insert targets:

        wrapper         -       The C++ wrapper source file. (example_wrap.cpp in the above example)
        header          -       Not yet implemented.
        dextern         -       The D extern source file. (example_extern.d)
        dshadow         -       The D shadow module. (example.d)

Enjoy!

 -- andy
