Initialization of templates inside templates

It is easy to initialize local statics. If it is the initialization of the internal template class of global variables, it is a problem, but it is always compiled.

 

for example

compile error

change to

Compilation passes but the ctor reference is still not initialized. It will also result in a compilation error symbol XXX not found

Since the destruction order of global variables is different under different compilers, it is still placed in local static variables. The security flaw is that the first call will consume some time.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324389404&siteId=291194637