Static member variable in template, with multiple dlls

后端 未结 7 949
不思量自难忘°
不思量自难忘° 2020-12-15 19:44

My code is built to multiple .dll files, and I have a template class that has a static member variable.

I want the same instance of this static member variable to be

7条回答
  •  一向
    一向 (楼主)
    2020-12-15 20:05

    The problem is that each different template instantiation is a different type with its own static variable that is not shared with other instances that have different template parameters. You could provide a non-template base class that contains the static variable.

提交回复
热议问题