Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Smart pointer
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== History == Even though C++ popularized the concept of smart pointers, especially the [[Reference counting|reference-counted]] variety,<ref name="Klabnik-Nichols_2023"/> the immediate predecessor of one of the languages that inspired C++'s design had reference-counted references built into the language. C++ was inspired in part by [[Simula67]].<ref name="Stroustrup"/> Simula67's ancestor was [[Simula I]]. Insofar as Simula I's ''element'' is analogous to C++'s pointer without ''null'', and insofar as Simula I's process with a dummy-statement as its activity body is analogous to C++'s ''struct'' (which itself is analogous to [[C. A. R. Hoare]]'s ''record'' in then-contemporary 1960s work), Simula I had reference counted elements (i.e., pointer-expressions that house indirection) to processes (i.e., records) no later than September 1965, as shown in the quoted paragraphs below.<ref name="Dahl-Nygaard_1966"/> <blockquote> Processes can be referenced individually. Physically, a process reference is a pointer to an area of memory containing the data local to the process and some additional information defining its current state of execution. However, for reasons stated in the Section 2.2 process references are always indirect, through items called ''elements.'' Formally a reference to a process is the value of an expression of type ''element''.<br> β¦<br> ''element'' values can be stored and retrieved by assignments and references to ''element'' variables and by other means.<br> The language contains a mechanism for making the attributes of a process accessible from the outside, i.e., from within other processes. This is called remote access- ing. A process is thus a referenceable data structure.<br> It is worth noticing the similarity between a process whose activity body is a dummy statement, and the record concept recently proposed by C. A. R. Hoare and [[Niklaus Wirth|N. Wirth]]</blockquote> Because C++ borrowed [[Simula]]'s approach to memory allocation{{Em dash}}the ''new'' keyword when allocating a process/record to obtain a fresh ''element'' to that process/record{{Em dash}}it is not surprising that C++ eventually resurrected Simula's reference-counted smart-pointer mechanism within ''element'' as well.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)