std::forward
Language
C++
Compiler
gcc 13.2.0
Options
Warnings
Boost 1.83.0
C++11
no pedantic
std::forward
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.83.0-gcc-13.2.0/include -std=c++11
int a: type is int
const int b: type is int const
int& lref: type is int&
int&& rref: type is int&&
Tprint:std::is_same<int &, T>():1
forward(&&):std::is_same<int, _Tp>():1
forward(&&):std::is_same<int&&, _Tp>():0
run _Tp&&
forward<int>(lref): type is int&&
forward<int &>(lref): type is int&
forward(&):std::is_same<int, _Tp>():1
forward(&):std::is_same<int&, _Tp>():0
forward(&):std::is_same<int&&, _Tp>():0
run _Tp&
Exit Code:
0