Topic: Smart references


Author: nessus@mit.edu (Douglas Alan)
Date: 1995/06/01
Raw View
I'm sorry if this has been asked many times before.

Does the draft C++ standard support any notion of "smart references".
Currently there are many procedures in my code that takes pointer
arguments rather than reference arguments because I need to reserve
the right in the future to replace the pointers with smart pointers so
that the smart pointers can implement reference-counting garbage
collection.  I would really like these pointer arguments to be
reference arguments instead.  If there were some way of implementing
"smart references" then I wouldn't have this dilemma.

|>oug /\lan
   <nessus@mit.edu>





Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 1995/06/02
Raw View
In article 95Jun1190431@twitch.mit.edu, nessus@mit.edu (Douglas Alan) writes:
>I'm sorry if this has been asked many times before.
>
>Does the draft C++ standard support any notion of "smart references".
>Currently there are many procedures in my code that takes pointer
>arguments rather than reference arguments because I need to reserve
>the right in the future to replace the pointers with smart pointers so
>that the smart pointers can implement reference-counting garbage
>collection.  I would really like these pointer arguments to be
>reference arguments instead.  If there were some way of implementing
>"smart references" then I wouldn't have this dilemma.

It sounds like you want to be able to overload operator "dot". Sorry,
that was debated for two years, considered and reconsidered, and
rejected overwhelmingly by the C++ committee everytime it was brought
to a vote. See the ARM or D&E for more discussion.

---
Steve Clamage, stephen.clamage@eng.sun.com