Closed tcbrindle closed 1 year ago
Patch coverage: 100.00
% and project coverage change: -0.01
:warning:
Comparison is base (
970b391
) 97.83% compared to head (2982ea2
) 97.83%.:exclamation: Current head 2982ea2 differs from pull request most recent head c47254c. Consider uploading reports for the commit c47254c to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Previously,
flux::ref()
did the same thing asstd::ref()
, except that the argument was required to be an lvalue sequence, and the result provided the inline sequence API to enable chaining.Now,
flux::ref()
does the same asstd::cref()
, and requires the argument to be a const-iterable sequence.The new
flux::mut_ref()
function does what the oldref()
did, but requires that its argument is a non-const lvalue reference. (The name seems a bit "rusty", but there are only so many ways to abbreviate the word "mutable"...).The idea is to promote "const by default", particularly when using references as for safety we want to avoid having multiple mutable references at one time if possible.
Finally, we also add member function versions of
ref()
andmut_ref()
, taking const- and non-const lvalues respectively.