member templates in VC++
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Does anyone know if VC++ 6 supports member templates? Dave
-
Does anyone know if VC++ 6 supports member templates? Dave
Seems to...well, to an extent: class Test { int x_; public: Test() : x_(0) {} template set(T t) { x_ = sizeof(T); } }; { Test t; t.set(int(3)); // OK t.set(4.0); // OK t.set(4); // Compile error :-( } i.e. explicit instantiation doesn't work - think it should do, as it does for non-member function templates. Hope this helps. Stuart Dootson 'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'