This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: template with friend function problem


> What is wrong with my instantiation of friend functions?

In C++, at the point of instantiation, the definition of a template
function (or class) must be visible - just having the declaration is
not enough. As a result, you must define the template implementation
in the header file. This is most easily achieved by #including
Vector.C into Vector.h.

Hope this helps,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]