C++ static template member, one instance for each template type?

后端 未结 4 1396
长情又很酷
长情又很酷 2020-11-29 10:16

Usually static members/objects of one class are the same for each instance of the class having the static member/object. Anyways what about if the static object is part of a

4条回答
  •  离开以前
    2020-11-29 10:48

    In C++ templates are actually copies of classes. I think in your example there would be one static instance per template instance.

提交回复
热议问题