template static classes across dynamic linked libraries

Posted by user322274 on Stack Overflow See other posts from Stack Overflow or by user322274
Published on 2010-06-18T11:40:17Z Indexed on 2010/06/18 11:43 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

Hello, I have a templated class with a static value, like this:

  template <class TYPE>
 class A{
  static TYPE value;
 };

in the code of a dll I assign the static value:

code of  DLL_1

A<float>::value = 2.0;

I wish the value to be shared by all the dlls I'm using, i.e. I want that:

code of DLL_2

printf("value on DLL_2 %f",A<float>::value);

print out "2.0"

any clues? thx

© Stack Overflow or respective owner

Related posts about c++

Related posts about class