المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Static Member Initialization Issue [Solved]



C++ Programming
02-13-2010, 05:31 PM
I have a struct similar to the following:
// foo.h
templatestruct foo {
public:
static const int a;
static const int b;
};

templateconst int foo::a = 1;
templateconst int foo::a = 2;
templateconst int foo::b = 3 * foo::a;
Then, I attempted to execute the following:
#include
#include "foo.h"
using namespace std;

int main() {
cout