public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: definition of "implicit" inline?
@ 2003-07-31 11:59 Robert Dewar
  2003-07-31 12:41 ` Gabriel Dos Reis
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 2003-07-31 11:59 UTC (permalink / raw)
  To: dewar, gdr; +Cc: gcc, martin

> I already give the reasons at multiple occasions in this debate with
> the appropriate quotes.
> The reason is mostly historic (see "The Design and Evolution of C++",
> section "Run-Time Efficiency").
> When inlining was orginally introduced in C with Classes, the only
> syntax available was definition within the class declaration and
> inlining was considered only for member functions.  Later, the keyword
> "inline" was introduced to permit inlining request for functions not
> defined within a class.  There is no slight difference nor implication
> that one form is superior to the other in terms of request.

history is not normative!

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: definition of "implicit" inline?
@ 2003-07-31 13:53 Robert Dewar
  2003-07-31 13:58 ` Gabriel Dos Reis
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 2003-07-31 13:53 UTC (permalink / raw)
  To: dewar, gdr; +Cc: gcc, martin


So, the quotes from the standard make it clear that the explicit inline
keyword is significant. I have no idea how the standard could be read
otherwise.

>   The inline specifier indicates to the implementation that inline
>   substitution of the function body at the point of call is to be
>   preferred to the usual function call mechanism.

Of course that's pretty meaningless given that all semantics is "as if". 
Whenever the standard appears to demand a particular code sequence, 
appearences are deceptive!

> There is no consensus, either, that the current logic is good.  
> I'm not shouting louder.  I'm just trying to get people to consider
> the *language* _under discussion_ and to prevent them from transmuting
> the intent of the keyword.  

But your quotes from the standard make it clear that no one is transmuting
anything here.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: definition of "implicit" inline?
@ 2003-07-31 13:12 Robert Dewar
  2003-07-31 13:37 ` Gabriel Dos Reis
  2003-08-02 17:21 ` Marc Espie
  0 siblings, 2 replies; 13+ messages in thread
From: Robert Dewar @ 2003-07-31 13:12 UTC (permalink / raw)
  To: dewar, gdr; +Cc: gcc, martin

> Certainly, but you asked for the reason -why- we had two syntaxes to
> say the same thing in the first place.  That is the reason.  
> I think that anyone who seriously wants to argue about C++ should
> read its history and especially "The Design and Evolution of C++" or
> else he would miss the most important points and do bogus claims.
> That, probably, is a key difference between Ada and C++.

No, you miss my point. There is an ISO standard for C++. The meaning of C++
is entirely contained within this history *WITHOUT* any reference to history.
That's the fundamental meaning of an ISO standard.

So from a formal point of view, an implementor need look only at the ISO
standard. Now, in cases where the standard does not prescribe things, it is
fine (in both C++ and Ada, there is absolutely no difference here, you are
imagining a difference, after all Ada is older than C++ from a standards
point of view :-) to take normal usage into account.

But your (somewhat hysterical I must say) claims that all C++ programmers
behave in a certain way with regard to the use and expectations of inline
is clearly unsupportable.

Why? Because clearly just from the input on the list, there is no such
consensus. You can't make a consensus by shouting louder.

So there really seems a problem that, to a much greater extent than is the
case with Ada, the programmer's intentions are not so clear with respect to
inline.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: definition of "implicit" inline?
@ 2003-07-31 11:02 Robert Dewar
  2003-07-31 11:04 ` Gabriel Dos Reis
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 2003-07-31 11:02 UTC (permalink / raw)
  To: gdr, martin; +Cc: gcc

> 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.

I find this exegesis confusing and self serving. It seems quite fine to
refer to the form without inline has being implicitly inlined. Whether the
two forms should or should not be treated differently is another matter.

One might ask *why* are there two forms. Perhaps someone should quote the
exact language from the standard here.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* definition of "implicit" inline?
@ 2003-07-31 10:02 Martin Reinecke
  2003-07-31 10:08 ` Gabriel Dos Reis
  2003-07-31 10:50 ` Andreas Schwab
  0 siblings, 2 replies; 13+ messages in thread
From: Martin Reinecke @ 2003-07-31 10:02 UTC (permalink / raw)
  To: gcc

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.

What's your take on this?

Thanks,
   Martin

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-08-02 10:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-31 11:59 definition of "implicit" inline? Robert Dewar
2003-07-31 12:41 ` Gabriel Dos Reis
  -- strict thread matches above, loose matches on Subject: below --
2003-07-31 13:53 Robert Dewar
2003-07-31 13:58 ` Gabriel Dos Reis
2003-07-31 14:00   ` Gabriel Dos Reis
2003-07-31 13:12 Robert Dewar
2003-07-31 13:37 ` Gabriel Dos Reis
2003-08-02 17:21 ` Marc Espie
2003-07-31 11:02 Robert Dewar
2003-07-31 11:04 ` Gabriel Dos Reis
2003-07-31 10:02 Martin Reinecke
2003-07-31 10:08 ` Gabriel Dos Reis
2003-07-31 10:50 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).