Why are local classes not allowed to have template-members?

  c++

Why is this code not allowed?

int main()
{
    struct S
    {
        template<bool F>
        void f123()
        {
        }
    };
}

My compiler complains, that members of local classes are not allowed to be templates. What’s the design decision behind that?

Source: Windows Questions C++

LEAVE A COMMENT