Dec 21, 2025

[C++][cppnow 2025] r-value connected

Reference:
Lightning Talk: C++ Rvalue Ranges Aren’t Always Yours - Robert Leahy


Interesting talk. Main concept is, if the viewer actually owns the value(i.e. passing in as r_value, aka. r-value connected), this can be chained and continue to pass down as viewer with r_value, instead of copy.

std::optional by design aware r_value, and by contract it is a viewer(as viewing the value, through either itself owning a copy of the value or owning the r-value).

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.