case 1: you can overload two functions namely:
void foo(int *);
void foo(const int *);
while in , case 2: you can not overload two functions:>
Top level CV qualifications for formal arguments are ignored wrt. determining the function's type.
(CV: const
or volatile
)
One way to understand it is, there is no way a top level CV qualification of a formal argument can affect a caller of the function, and it can't affect the machine code. It's only about restrictions on the implementation. So given a declaration void foo( int )
you can use void foo( const int )
for the implementation, or vice versa, if you want.