What restrictions does ISO C++03 place on structs defined at function scope?

后端 未结 5 1999
情深已故
情深已故 2020-12-10 13:06

We\'re not allowed to define a functor struct inside a function because one is not allowed to use function declared structs in the instantiation of function templates.

5条回答
  •  我在风中等你
    2020-12-10 13:36

    Local structs / classes can't have static data members, only static member functions. Also, they can't be templates.

提交回复
热议问题