Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by kwas ( 16 years ago )
#include <iostream>

template<class T> class Test
{
public:
    static bool var;
    static bool initFn() {return true;}
};

template<class T> bool Test<T>::var = Test<T>::initFn();

int main() {
    Test<int> t;
    if (t.var) {
        std::cout << "yes!" << std::endl;
    } else {
        std::cout << "no!" << std::endl;
    }
}

 

Revise this Paste

Your Name: Code Language: