Function Subspace :: sus :: mem :: clone_or_forward
template <class T>
auto clone_or_forward(const std::remove_reference_t<T>& source) -> T
requires
sus::mem::CloneOrRef<T>
Clones the input either by copying or cloning, producing an object of type
T
. As with forward
, the template argument T
must always be specified when calling this function to deduce the correct
return type.
If T
is a reference type, it copies and returns the reference instead of
the underlying object.