DEV Community

Seongcheol Jeon
Seongcheol Jeon

Posted on

[C++] std::forward

forward<utility> 헤더에 정의되어 있다.

template <class T>
constexpr T&& forward(std::remove_reference_t<T>& t) noexcept; // (1)

template <class T>
constexpr T&& forward(std::remove_reference_t<T>&& t) noexcept; // (2)
Enter fullscreen mode Exit fullscreen mode

(1) 오버로딩의 경우, lvalueT에 따라 lvalue 혹은 rvalue로 전달한다.

Top comments (0)