Skip to content

Commit

Permalink
Document forming references to One
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jun 15, 2022
1 parent ab3b8e5 commit 284bf6b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/pages/llama_vs_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,25 @@ Values and references
auto y = view[i](Pos{});

:cpp:`y` is a copy (of type :cpp:`float`), not a reference!
* - Create a copy of a single local record
- .. code:: C++

auto p2 = p;
- .. code:: C++

auto p2 = p;
-
-
* - Create a reference to a single local record
- .. code:: C++

auto& r = p;
- .. code:: C++

auto r = p();
Access with an empty tag list.
-
-


Notice that the use of :cpp:`auto` to declare a local copy of a value read through a reference, e.g. :cpp:`auto pos = view[i].pos; // copy`, does not work as expected in LLAMA.
Expand Down

0 comments on commit 284bf6b

Please sign in to comment.