Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by jmborr

  1. jmborr

    foo(int a): b(a) {} What is this sintax??

    Great! Many thanks for the info. -jmborr
  2. jmborr

    foo(int a): b(a) {} What is this sintax??

    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
  3. jmborr

    template definition MUST go in the header file???

    If this is the case, then I'm in trouble because I generate multiple definitions of "foo" ! If I include "template.h" into files "one.cpp" and "two.cpp", and then I do "g++ one.o two.o", I will generate two definitions of "foo&quot...
  4. jmborr

    template definition MUST go in the header file???

    Hi all, I have a &quot;template.h&quot; file with a class template declaration, and I have &quot;template.cpp&quot; 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...
  5. jmborr

    operator inheritance from a class template???

    Wow, who could have imagined this? I was puzzled because I had also defined operators '+', '+=&quot; and I had no complain with these ones. Thank you for the huge help :) jose
  6. jmborr

    operator inheritance from a class template???

    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> { }...
  7. jmborr

    operator inheritance from a class template???

    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> { }...

Part and Inventory Search

Back
Top