This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::pow implementation


dewar@gnat.com (Robert Dewar) writes:

| > Sigh.  In C++, the programmer has already done the needed analysis, and
| > has attached the keyword "inline" or defined the function in the class
| > body.  Certainly, with -O3 the kind of analysis you describe would be
| > appropriate, though possibly expensive.
| 
| 
| This claim is made repeatedly, but without any evidence. I think a lot of
| C++ programmers decide whether to put thins in the class body on the basis
| of other considerations than whether to inline -- a consideration that is
| pretty hard to do for the great majority of C++ (or Ada for that matter)
| programmers who have not the slightest awareness of machine language or
| its implications.

You should not underestimate C++ programmers ability to make considerations.

| I do agree that if the programmer has attached the keyword "inline" then
| that shows at least some thought, though whether it is well informed or
| not can often be an issue.

Defining a member function within a class declaration has exactly the
same meaning.  And that has been documented in every manual since 1981.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]