>From: "Alsop, Thomas R" <thomas.r.alsop@intel.com> >So it sounds like the proposal is going to have code that looks >something like this. Does this look right? It matches what I was thinking. I have not thought this through all the way. It is likely that if a more general pointer mechanism were added, users would come up with a lot of other ways they would want to use them. They might want a lot of extensions to the basic concept. We would want to consider that, and avoid defining things in a way that would prevent extending them later. It may already be too late for this. Decisions may already have been made, under the assumption that classes would provide all the support needed for user-defined data structures requiring pointers. The LRM already contains a rationalization for why we have both structs and classes, with classes not just being an extension of structs. If more general pointers get added, the overlap starts to approach having two independent versions of the same construct in the language. One tiny issue I already mentioned is the use of "const ref" instead of "ref const" for ref args. Presumably "static ref" in a class would indicate a static member, so we would have to use "ref static" to mean a ref to a static. In the same way, "const ref" in a class would indicate a const member that can only be assigned when initialized. So we would have to use "ref const" to mean a ref to a const, which cannot be used to modify the object referenced. But ref args already used "const ref" to mean that, so it is confusing. Maybe some other scheme is possible, but this is what looks most reasonable to me. I think we would want to deprecate "const ref" for ref args, and use "ref const" to mean that instead. Fortunately, you cannot modify what a ref arg references after the call, so there is no need for "const ref" to mean that. That one came up just in suggesting a syntax for "ref static". When we start considering semantic interactions with the rest of the language, much more serious problems will probably arise. Steven Sharp sharp@cadence.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Oct 7 12:58:35 2008
This archive was generated by hypermail 2.1.8 : Tue Oct 07 2008 - 12:59:16 PDT