ref
- noun
- /rɛf/
- Specialized
- When passing a large object to a function, using a ref can optimize performance by avoiding unnecessary copying.
Examples
-
The ref keyword in programming helps ensure that changes to a variable within a function persist outside of it.
-
The constructor is initialized with a ref count = 1, but in my assignment operator, I am retaining the object, making the ref count = 2.
Blog text (18) -
Once you've mutated your multi value ref, set it back on the person and then save the address book.
-
So this is a function in UI Kit that tells UI Kit to create a new CG context ref that points to a piece of memory that is as big as size.
-
In C#, you must declare a parameter as a ref type to allow the function to modify the original variable.
Synonyms
The thing a word or phrase points to
Surface Forms
Etymology
Ref in programming is short for reference, which means 'a way to point to something'. So a ref parameter lets a function point to and change the original variable.