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]
Other format: [Raw text]

Re: -fobey-inline (was Re: gcc and inlining)


On Tuesday, 18 March 2003 07:22, you wrote:
> On Tue, Mar 18, 2003 at 07:18:30AM +1200, Ross Smith wrote:
> > The vast majority of inline functions in modern C++ are templates.
> > Templates _have_ to be inline, either defined inside a class
> > definition or explicitly marked inline if they're defined out of
> > line or aren't class members. There's no portable way to use
> > templates without marking them inline.
>
> This is not correct.  The template has to appear in the header; it
> need not be declared inline.

Yes it does. A function defined in a header but not inline will trigger 
ODR violations as soon as more than one module includes it.

-- 
Ross Smith ......... r-smith at ihug dot co dot nz ......... Auckland, New Zealand

Eagles may soar, but weasels never get sucked into a land war in Asia.


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