Skip to main content

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
274 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 ...
texdr.aft's user avatar
  • 253
1 vote
1 answer
179 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); ...
user23013's user avatar
  • 2,510
3 votes
4 answers
283 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 ...
abel1502's user avatar
  • 2,527
6 votes
2 answers
283 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 ...
CPlus's user avatar
  • 8,321