🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #831

Re: HELP! inline public member functions in GNU g++ ?

#831
From: Ilan Kochavi
Date: Wed, 22 Nov 1995 03:10
48 lines
1575 bytes
alex@elementrix.co.il (Alex Ruzin) wrote:
>Hi !
>
>Can I use any public inline member functions in GNU C++ ?
>In class definition ( *.h file ), I wrote 'inline', in class discription
>( *.cpp file ) I discribed the function without 'inline'. As result, I 
>received from linker 'Undefined symbols'. 
>
>For private functions there was no any such problems.
>
>For Borland C++ (V 4.5) I have no such problems at all. But my purpose is to 
>build some PORTABLE software both for UNIX and for Windows.
>
>Thank You, Alex
>----Elementrix Technologies ltd. -----
>Name:   Alex E. Ruzin
>Job:    MATAM bld. 20 Haifa 31905 Israel
>E-mail: alex@elementrix.co.il
>Phone:  +972-4-550042   Fax: +972-4-550-356
>

Any code using your inline function must see the inlined source code. Therefore 
inline source code of a public member function must be included in the header file. 
I suuposed Borland does not really inline your function.

Example :

File Sample.h :

class Sample
{
 public:

  . . .

  inline int f();

  . . .
};

inline int Sample::f()
{
 . . . 
}


-------------------------------------
 ilan@uxsrvc.tti.co.il (Ilan Kochavi)
Technical Details
Message-ID: <gnusenet48ru9n$duq@news.netvision.net.il>
Path: arc1-ca.pugleaf.net!uxsrvc.tti.co.il!ilan
References: <48mpo7$pq9@news.netvision.net.il>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!uxsrvc.tti.co.il!ilan
From: ilan@uxsrvc.tti.co.il (Ilan Kochavi)
Newsgroups: gnu.g++.help,comp.lang.c++
Subject: Re: HELP! inline public member functions in GNU g++ ?
Date: 21 Nov 1995 22:10:52 -0500
Organization: T.T.I.
Sender: daemon@cis.ohio-state.edu
Distribution: world
Message-ID: <gnusenet48ru9n$duq@news.netvision.net.il>
References: <48mpo7$pq9@news.netvision.net.il>