Hi
Here's a sintax in the constructor I've never seen, nor can I find an explanation:
class foo{
public:
foo(int a): b(a) {} //the constructor
private:
int b;
};
One could define foo(int a){ b=a; }. Why the different definition?
jmborr
Hi all,
I have a "template.h" file with a class template declaration, and I have "template.cpp" file with the definition of this class template.
It turns out that I have the following compilation error:
undefined reference to `vec<double>::foo()'
After googling, I found a...
Hi all,
For some reason, my derived class does not inherit the operator '=' of my base class, which is a class template, when I compile with g++
//=========== base class
template<class T>
class vec{
public:
vec &operator=( vec ) ;
};
//=========== derived class
class vec_d : vec<double> {
}...
Hi all,
For some reason, my derived class does not inherit the operator '=' of my base class, which is a class template, when I compile with g++
//=========== base class
template<class T>
class vec{
public:
vec &operator=( vec ) ;
};
//=========== derived class
class vec_d : vec<double> {
}...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.