This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4 + no inline template functions => undefined symbol ! ?
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: "Sébastien L." <sleon at pointcarre dot com>, gcc-help at gcc dot gnu dot org
- Date: Fri, 01 Jul 2005 08:52:47 -0500
- Subject: Re: GCC 4 + no inline template functions => undefined symbol ! ?
- References: <42C5483C.90304@pointcarre.com>
Hi Sébastien,
>May be gcc 4 just support inline functions for templates? (but why gcc 3.4 has no problem with that?)
GCC 4 supports non-inline functions for templates for me, just fine.
template <typename T>
T NonInline(T input)
{
return input - 1;
}
template <typename T>
inline T Inline(T input)
{
return input + 1;
}
int main()
{
int i = 10;
i = NonInline(i);
i = NonInline(i);
i = NonInline(i);
i = NonInline(i);
int j = 10;
j = Inline(j);
j = Inline(j);
j = Inline(j);
j = Inline(j);
}
Sincerely,
--Eljay