home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!world!wmm
- From: wmm@world.std.com (William M Miller)
- Subject: Re: Handling of operator . proposal
- Message-ID: <BryIM5.KFH@world.std.com>
- Organization: Software Emancipation Technology, Inc.
- References: <Bqs38H.4L9@taligent.com> <1070008@speedy.CND.HP.COM>
- Date: Sat, 25 Jul 1992 18:13:16 GMT
- Lines: 52
-
- In article <1070008@speedy.CND.HP.COM>, Darren Smith writes:
- > [ Side note: Is that last statement really truly? If I do something
- > like (*anobject).member, the offset to member will be evaluated at
- > comile time, but the actual location in memory is determined at
- > runtime. ]
-
- It's the "*anobject" that's evaluated at runtime; once that's done,
- the processing is exactly the same as if you had used the name of a
- static or auto object to the left of ".".
-
- > The argument that operator.() is only a syntactic operation is
- > essentially a meaningless, though true, statement. The question is:
- > is there a good reason that it should remain so?
-
- The issue is one of analogy -- all the currently overloadable
- operators have a runtime component in the builtin version. Adding
- runtime behavior to an operator that doesn't have it now would be a
- completely new thing.
-
- In the expression "expr.member", the entire runtime component is in
- the evaluation of "expr", not in the ".". To add smart references in
- a way that is consistent with the current language would mean changing
- how "expr" is evaluated, not what "." means. That's the basis of both
- the alternative ideas I mentioned in comp.std.c++ a few days ago --
- using either delegation via pointer or conversion to reference to
- convert "expr" into a reference to the target class.
-
- > Also, saying that operator.() is only a syntactic operation, says that
- > you will never support *any* proposal that makes operator.() overloadable
- > in a way that requires a runtime decision (I can envision a scheme that
- > could work at compile time only).
-
- This is too strong. I don't view the "operatorizing" of "." to be a
- fatal flaw in this proposal, just one that reduces its attractiveness
- and must therefore be weighed with its other pros and cons.
-
- > If that is truly your position, then
- > make that a separate argument from a critique of a given proposal. That
- > way people can understand better your position, which is not that a
- > given proposal is bad, but that all proposals for overloading operator.()
- > are bad.
-
- I have said that I would prefer a smart-reference proposal that does
- not involve operator.() to one that does involve operator.(), all
- other things being equal. The problem is that they never are. If the
- other pending non-operator.() approaches prove to be more problematic
- than the best operator.() proposal, I would support the latter. In
- the meantime, however, as Jim has pointed out, his is the most
- fully-developed proposal around right now, hence it seemed appropriate
- to direct my concerns at it specifically rather than at the generic
- concept.
-
-