On Tuesday, 5 March 2013 at 00:41:23 UTC, Andrej Mitrovic wrote:
 3/5/13, Rob T <al...@ucora.com> wrote:
In that case it would be nice to avoid most of the class name
duplication, that's one of the things I really disliked about C++.

I guess you meant:

class A
{
    class B;
}

class A.B
{
    // implementation
}

Ideally both styles would be supported.

Actually I had meant this instead, which reduces duplication

class A
{

}

class A.B
{
    // implementation
}

There should be no need to define class B inside class A, because the compiler can easily know that class A.B means that B is included inside A. It adds on some more work for the compiler, but it's doable.

However, I'm not so sure how useful such a thing really is if all it does is save on adding indentations for sub classes.

--rt

Reply via email to