Questions tagged [references]
For questions about references, a superset of pointers, which refer to the location of an existing value rather than storing a value independently.
5 questions
8
votes
2
answers
625
views
Analysis of methods to ensure memory safety
Overview
Ensuring memory safety is a core facet of modern programming language design. Memory safety can be guaranteed in many different ways.
For the purposes of this question, I am defining memory ...
1
vote
1
answer
400
views
References in a language where everything is a reference?
I'm a big fan of Algol 68's treatment of variables. "Variables" are just constant references that point to memory allocated on the stack or on the heap. When you refer to a variable or a ...
1
vote
1
answer
191
views
How does languages distinguish passing a parameter by value and reference, especially with non-parameter direct initializations in consideration?
Background
What I want is to make the behaviors of the following two pieces of code identical:
specifier x = getX();
doSomething(x);
...
3
votes
4
answers
333
views
Common postfix representations of pointer/reference operations
In some C-based languages (including C/C++ themselves and Rust), taking pointers/references and dereferencing is done with prefix operators & and ...
6
votes
2
answers
383
views
How are C++ style references implemented behind the scenes? Could they be implemented without pointers?
I would not be surprised if C++ style int &y = x; was no more than int *y = &x; behind the scenes and every use of ...