c++/10541: Is NULL a valid pointer-type template argument?

Wolfgang Bangerth bangerth@ices.utexas.edu
Tue Apr 29 17:56:00 GMT 2003


> I remember reading a while back that C/C++ considers the value 0 to be a 
> valid value for any pointer type.  Hence 0 CAN BE of type char *.

Well, 0 is of type "signed int". It can be converted to any pointer type 
implicitly. The question is whether the compiler is supposed to do 
implicit conversions for template args. I don't think so.

> Other compilers seem to take this value.

icc doesn't, for example.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/




More information about the Gcc-bugs mailing list