This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/14078] Manipulators are slow


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


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