Re: implicit type cast problem of reference of ponter to const type
On Sat, Apr 16, 2005 at 01:13:46PM +0800, Steve Yee wrote: > the following code can not compile. is it due to the standard? Yes, this is not valid C++. int* -> const int* creates a temporary and you can't bind a non-const reference to a temporary. You might mean void testfun(int * const & pr) o
implicit type cast problem of reference of ponter to const type
the following code can not compile. is it due to the standard? void testfun(const int *&pr) { } main() { int *p; testfun(p); }