copy(3) copy(3)

NAME

copy - cast to const xvalue

SYNOPSIS

#include <cfl/utilities/copy.hpp>

int i {0};

decltype (copy (i)) == int const &&;

DESCRIPTION

Similar to std::move, but casts an argument to a const xvalue.

Belongs to the group of functions used to modify function argument cv and reference qualification.

STANDARDS

Not a container function.

NOTE

Should be applied with caution, as it may produce a dangling reference. In particular, the rule for extending the lifetime of a prvalue bound to a reference does not apply through a function call.

SEE ALSO

move(3), constfwd(3)