[Bug libstdc++/14078] Manipulators are slow

peturr02 at ru dot is gcc-bugzilla@gcc.gnu.org
Tue Feb 10 15:55:00 GMT 2004


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



More information about the Gcc-bugs mailing list