[/ Copyright 2007 John Maddock. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). ] [section:add_reference add_reference] [note This trait has been made obsolete by __add_lvalue_reference and __add_rvalue_reference, and new code should use these new traits rather than __is_reference which is retained for backwards compatibility only. ] template struct add_reference { typedef __below type; }; template using add_reference_t = typename add_reference::type; // C++11 and above __type If `T` is not a reference type then `T&`, otherwise `T`. __std_ref 8.3.2. __header ` #include ` or ` #include ` [table Examples [ [Expression] [Result Type]] [[`add_reference::type`][`int&`]] [[`add_reference::type`] [`int const&`]] [[`add_reference::type`] [`int*&`]] [[`add_reference::type`] [`int*&`]] ] [all_compilers] [endsect]