Std::remove reference
lastmod 2026-11-10created 2015-06-182 edits
std::remove_reference is a type transformation trait in C++11 <type_traits> that gives, through the type member (or std::remove_reference_t), the given type with its lvalue or rvalue reference stripped. Non-reference types are returned unchanged, and it is the basic tool std::move and std::forward use to build their return types. To also remove const and volatile, use std::remove_cvref (C++20) or combine it with remove_cv.