Afficher un message
Vieux 06/06/2008, 22h27   #6
Alf P. Steinbach
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why arguments are not incompatible

* metarox:
> [referring to earlier function 'void foo( const int i ) ...']
>
> The compiler sees this for #2
>
> void foo(int i)
> {
> int local = i;
>
> }


Well, sorry, that's incorrect.

True, the function signatures, as pure declarations,

void foo( int );

and

void foo( int const );

are equivalent.

That does not mean that the 'const' has no effect in a function definition.


> Using const with a pass by copy argument is useless.


Sorry, that's incorrect.


Cheers, & hth.,

- Alf

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
  Réponse avec citation
 
Page generated in 0,04342 seconds with 9 queries