"Asger K. Alstrup Nielsen" <[EMAIL PROTECTED]> writes:

| > JMarc> I am a bit surprised by the following:
| > JMarc> -Bullet::Bullet(const int f, const int c, const int s)
| > JMarc> +Bullet::Bullet(int f, int c, int s)
| > 
| > Whoa! Aren't f, c and s passed by value here, so it makes no sense to declare
| > them const anyway?
| 
| If you do
| 
| int foo(int const bar) {
|       bar = 1; // Illegal
| }
| 
| If you do
| 
| int foo(int bar) {
|       bar = 1; // Legal
| }
| 
| Such a thing makes sense in a few isolated cases.

And those cases are so few that I won't allow such code unless you
 have a real good reason for it.

| For instance,
| the const-version can in a few lucky cases result in more optimized
| code.

This is not even micro-optimization, closer to nano-optimization. And
as such pointless.

        Lgb

Reply via email to