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

后端 未结 4 1398
长情又很酷
长情又很酷 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:59

    There are as many static member variables as there are classes and this applies equally to templates. Each separate instantiation of a template class creates only one static member variable. The number of objects of those templated classes is irrelevant.

提交回复
热议问题