Forward an lvalue as either an lvalue or an rvalue.

Synopsis

Declared in <absl/utility/utility.h>

template<class T>
[[deprecated("Use std::forward instead."), nodiscard]]
constexpr
T&&
forward(std::remove_reference_t<T>& arg) noexcept;
Warning

Deprecated: Use std::forward instead.. Use of this entity is allowed but discouraged.

Return Value

arg cast to the deduced reference type.

Note

The return value should not be discarded.

Parameters

Name

Description

arg

The value to forward.

Created with MrDocs