Compiler chokes on a simple template - why?

2005-03-17 Thread Topi Maenpaa
Hi, Here is a snippet that does not compile with gcc 3.4.1 (on Mandrake 10.1). --- template class A { public: template void test(T value) {} }; template void test2(A& a, T val) { a.test(val); } int main() { A a; a.test(1); //works fine

Why aren't assignment operators inherited automatically?

2005-03-16 Thread Topi Maenpaa
The question can be shortly formulated in C++ code as follows: //Our fancy base class class A { public: //three (ought to be) equivalent functions with different names A& operator= (int value) { return *this; } A& operator*= (int value) { return *this; } A& test(int value) { return* this;