This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: jbuck at synopsys dot com, aoliva at redhat dot com, bernds at redhat dot com, gcc at gcc dot gnu dot org, rguenth at tat dot physik dot uni-tuebingen dot de, s dot bosscher at student dot tudelft dot nl
- Date: 04 Aug 2003 19:34:27 +0200
- Subject: Re: std::pow implementation
- Organization: Integrable Solutions
- References: <20030804172640.AB3C6F2D85@nile.gnat.com>
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