This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: how can I solve this template problem?


Hi,

It appears that your foo.hh does not include foo.cc at the end of that
header file.

The routines in foo.cc are DECLARATIONS.

I know, they look suspiciously like DEFINITIONS, but they are not.  They are
defined when they are instantiated.

Templates are like that.  (So are inline functions.)  For general use, they
belong in header files.

--Eljay


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