On Saturday, 2 February 2013 at 06:04:01 UTC, TommiT wrote:
What do you suppose would happen if I wrote the following?

struct A
{
 <snip>
    static int otherFunction()
    {
      C cc;
      return cc.myMemberFunction();
    }

It would refuse to compile as a static function can't point to an instance/parent. I'm convinced you should not be able to return (or create an instance of) a nested struct outside of it's level of control or ability to reference properly.

 Had it not been static on the other hand...

            int otherFunction()

cc has the same level as c, so the return would be equal to: _a + _b + cc._c

Reply via email to