[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++: Problem with overloading a constructor when splitting asrc file.
- To: Shaul Karl <shaulka(at-nospam)bezeqint.net>
- Subject: Re: C++: Problem with overloading a constructor when splitting asrc file.
- From: guy keren <choo(at-nospam)actcom.co.il>
- Date: Sun, 18 Nov 2001 02:12:57 +0200 (EET)
- cc: <linux-il(at-nospam)linux.org.il>
- Delivered-To: linux.org.il-linux-il@linux.org.il
- In-Reply-To: <E165FYH-0004S9-00@rakefet>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
On Sun, 18 Nov 2001, Shaul Karl wrote:
> > you have put an inline function inside a '.cc' file. since it is inline,
> > it will NOT be included in the object file 'base.cc', and thus, during
> > link, there base constructor will be undefined. this is your bug - not
> > g++'s.
> >
> > fixes:
> >
> > 1. move the inline function into the header file.
> > 2. make the function not 'inline'.
>
> Are there no other options? In particular, one that is both inline and
> with split files? (inline for speed and splitting the src for
> readability)
by definition - no. you split source - you can't do inline. inline works
if you put it in the header file. that's the idea of inline - copying the
code to all other sources, rather then having a real function in the
resulting object file.
--
guy
"For world domination - press 1,
or dial 0, and please hold, for the creator." -- nob o. dy
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il