Class definition inside function body

Hello. Is this standard-compliant code?

1
2
3
4
5
6
7
8
9
10
11
int f()
{
    class C {
    public:
        int mf() const {return 1;}
    };

    C c;

    return c.mf();
}

Yes.
Topic archived. No new replies allowed.