Hello,
currently i experience something that i don't understand.
Suppose i have a class
Code:
#include <string>
template<typename T>
class ContainerClass
{
public:
static T doSomething(T a, T b)
{
std::string name = ContainerClass<T>::someString;
return doSomethingAgain(name, T);
}
static std::string someString;
};
All of this is in a header file. What i now did was to initialize the static member someString in my main.cpp file like:
Code:
std::string ContainerClass<float>::someString = std::string("test");
std::string ContainerClass<double>::someString = std::string("test");
I use VS2008. When compiling under Debug someString is set correctly, but when compiling for Release the someString doesn't seem to be set at all.
How can this happen?
Best regards, threahdead