This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: definition of "implicit" inline?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Martin Reinecke <martin at MPA-Garching dot MPG dot DE>
- Cc: gcc at gcc dot gnu dot org
- Date: 31 Jul 2003 10:36:38 +0200
- Subject: Re: definition of "implicit" inline?
- Organization: Integrable Solutions
- References: <3F28CFED.3020002@mpa-garching.mpg.de>
Martin Reinecke <martin@MPA-Garching.MPG.DE> writes:
| Hi,
|
| there seems to be a lot of confusion concerning the term
| "implicit inline". Maybe it would remove some misunderstandings
| if everyone would state clearly what he means by this term.
|
| In C++, the expression
|
| long a;
|
| is equivalent to
|
| long int a;
|
| This behavior is called "implicit int".
|
| If I'm not greatly mistaken, the code
|
| class foo {
| void bar() { ...}
| };
|
| is also equivalent to (i.e. should be treated by the compiler
| in the same way as)
|
| class foo {
| inline void bar() { ...}
| };
|
| (see, e.g. Struostrup, 3rd ed, chapter 10.2.9)
|
| What's wrong about calling this behavior "implicit inline"? I'd
| argue it practically begs for that name.
Because
1) it is the original syntax for "inline" -- as I already explained.
2) It confused people into thinking that the inline is not requested
-- we already have evidence for such confusion, and this by some
midlle end people, and that IS very alarming.
I think we're better off just avoid that term for that situation
because it means different thing for different people. And we
already have a name for that -- just "inline" -- why invent a new
one that end to confuse people? See "The Design and Evolution of C++",
section "Run-Time Efficiency".
3) implicit inline seems to mean different thing for middle end
people who think that it means "I don't care".
Let's keep it simple and straight. The example you gave is just that
of an inline function, not implicit inline function. There is nothing
implicit about it. It is an alternate syntax for defining an inline
function. Not a syntax for defining an implicit inline function.
-- Gaby