prog.cpp: In function ‘int main()’:
prog.cpp:20:13: error: no matching function for call to ‘forward(int&)’
forward( a );
^
prog.cpp:20:13: note: candidates are:
prog.cpp:11:5: note: template<class T> T&& forward(typename identity<T>::type&&)
T&& forward(typename identity<T>::type&& a)
^
prog.cpp:11:5: note: template argument deduction/substitution failed:
prog.cpp:20:13: note: couldn't deduce template parameter ‘T’
forward( a );
^
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
from /usr/include/c++/4.8/bits/stl_algobase.h:64,
from /usr/include/c++/4.8/bits/char_traits.h:39,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/bits/move.h:87:5: note: template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_From>::type&&)
forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
^
/usr/include/c++/4.8/bits/move.h:87:5: note: template argument deduction/substitution failed:
prog.cpp:20:13: note: couldn't deduce template parameter ‘_Tp’
forward( a );
^
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
from /usr/include/c++/4.8/bits/stl_algobase.h:64,
from /usr/include/c++/4.8/bits/char_traits.h:39,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:1:
/usr/include/c++/4.8/bits/move.h:76:5: note: template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_From>::type&)
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
^
/usr/include/c++/4.8/bits/move.h:76:5: note: template argument deduction/substitution failed:
prog.cpp:20:13: note: couldn't deduce template parameter ‘_Tp’
forward( a );
^