标签: c++ templates stl
在阅读有关c ++模板的一些SO问题时,通常是我没写的代码,我遇到了这样的构造:
template<class T> std::add_lvalue_reference_t<T> my_foo(T &t) { /*do some stuff and return*/ }
另一方面,我一直在使用这样的东西:
template<class T> T &my_foo(T &t) { /*do some stuff and return*/ }
所以我有几个问题: