Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!infopiz!lupine!lupine.ncd.com From: rfg@lupine.ncd.com (Ron Guilmette) Newsgroups: comp.std.c Subject: Rationale for allowing const T* = T* wanted. Message-ID: <3913@lupine.NCD.COM> Date: 15 Feb 91 18:50:27 GMT Sender: rfg@NCD.COM Organization: Network Computing Devices, Inc., Mt. View, CA Lines: 27 I have been stirring up trouble in x3j16 (the C++ standardization committee) with a recent suggestion that C++ ought to allow: T** p1; const T** p2; ... p2 = p1; ANSI C type compatability rules do not allow such assignments. I would like to see C++ allow them. In researching my arguments in favor of this proposal, I turned to the ANSI C standard and to its rationale document to see if x3j11 had considered this issue already, and (if so) what their reasons were for rejecting it. The second paragraph under 3.2.2.3 in the ANSI C standard discusses allowable conversions of pointer type values where the pointed-at types are qualified by type qualifiers (i.e. `const' or `volatile' or both). In the copy of the x3j11 rationale I have however, I see no mention at all of anything relating to this whole topic. Could somone who was on x3j11 please describe for me why that committee decided to allow a `T*' to be assigned to a `const T*' while at the same time making it illegal to assign a `T**' to a `const T**'? Thanks in advance.