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

From "Bo Persson" <bop@gmb.dk>
Newsgroups comp.lang.c++
Subject Re: how to inline member function is a separate file
Date 2012-02-22 20:16 +0100
Message-ID <9qkt89FdajU1@mid.individual.net> (permalink)
References <17823047.699.1329714548355.JavaMail.geo-discussion-forums@pbgq3> <inline-20120220063504@ram.dialup.fu-berlin.de>

Show all headers | 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