The libstdc++ tr1::reference_wrapper
implementation has this:
template<typename... _Args>
typename result_of<_M_func_type(_Args...)>::type
operator()(_Args&... __args) const
{
return __invoke(get(), __args...);
}
The result_of
expression uses a by-value _M_func_type
parameter (which is the template parameter of the reference_wrapper
i.e. Test
), so it tries to form the function type Test()
, which uses a by-value Test
return type, which is invalid for an incomplete or abstract type. I think I fixed this for std::reference_wrapper
ages ago, it needs to use result_of<_M_func_type&(Args...)>
.
The TR1 implementation in libstdc++ is not really maintained any longer - TR1 served its purpose but its time has passed.