Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #14431

Re: how to inline member function is a separate file

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Bo Persson" <bop@gmb.dk>
Newsgroups comp.lang.c++
Subject Re: how to inline member function is a separate file
Date Wed, 22 Feb 2012 20:16:36 +0100
Lines 25
Message-ID <9qkt89FdajU1@mid.individual.net> (permalink)
References <17823047.699.1329714548355.JavaMail.geo-discussion-forums@pbgq3> <inline-20120220063504@ram.dialup.fu-berlin.de>
X-Trace individual.net fGAJ92h2liCTId2TjEgVZQnVDvVscXvoIunbUP7TJaftHQRKLQ
Cancel-Lock sha1:+vBKgHBGp3AZUIzc+v9vX36ky94=
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.6157
X-RFC2646 Format=Flowed; Original
X-Antivirus avast! (VPS 120222-0, 2012-02-22), Outbound message
X-Antivirus-Status Clean
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:14431

Show key headers only | View raw


Stefan Ram wrote:
> Stanley Rice <heconghui@gmail.com> writes:
>> ok. Just prefix the inline keyword in preceed the function
>> definition.
>
>  »inline« does not precede a function-definition, it is part
>  of a function-definition.
>
>      »An inline function shall be defined in every
>      translation unit in which it is used and shall have
>      exactly the same definition in every case (3.2).« 7.1.2p4
>
>  This means it needs to be defined in the ».h« or ».hpp« file.

No, it doesn't necessarily mean that. We first have to check the 
compiler documentation for what it considers a translation unit.

Using g++ with link time optimizations (LTO) will compile the entire 
program at once. I guess trying version 4.6 instead of 4.4 would make 
it work.


Bo Persson

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how to inline member function is a separate file Stanley Rice <heconghui@gmail.com> - 2012-02-19 21:09 -0800
  Re: how to inline member function is a separate file Ian Collins <ian-news@hotmail.com> - 2012-02-20 18:31 +1300
  Re: how to inline member function is a separate file Jun Fang <heyfng@gmail.com> - 2012-02-20 02:16 -0800
  Re: how to inline member function is a separate file Juha Nieminen <nospam@thanks.invalid> - 2012-02-20 10:26 +0000
  Re: how to inline member function is a separate file "Bo Persson" <bop@gmb.dk> - 2012-02-22 20:16 +0100
    Re: how to inline member function is a separate file Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-22 20:29 +0000
      Re: how to inline member function is a separate file Robert Wessel <robertwessel2@yahoo.com> - 2012-02-22 21:42 -0600

csiph-web