This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14078] Manipulators are slow
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Feb 2004 15:55:39 -0000
- Subject: [Bug libstdc++/14078] Manipulators are slow
- References: <20040209093043.14078.peturr02@ru.is>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From peturr02 at ru dot is 2004-02-10 15:55 -------
> However, I still don't understand your considerations about the const
> argument: the signature is fixed in 27.6.1.2.3 and 27.6.2.5.3, isn't it?
A top level const isn't part of the signature, so
void f(int n)
is the same as
void f(int const n)
In the same way
void f(ios_base& (*pf)(ios_base&))
is the same as
void f(ios_base& (*const pf)(ios_base&))
The only reason I suggested that the argument should be declared const is
that it seems to make a difference in practice (in fact, about 44%). I
don't know why it does though, the compiler should be able to figure out
on it's own that pf isn't modified in the body of the function.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14078