3
爲什麼參考塌陷不參考與模板模板類崩
template<typename T, template<typename> class C>
void f(C<T> && x); // x declaration is an rvalue!
申請我怎麼能完全向前,我怎麼能避免超載常量左值裁判,左值裁判,右值裁判的所有組合中
template<typename T> // not necessary a template template class here
void f(C<T>, C<T>, C<T>, ..., C<T>)
{
// do something with T
// move or copy arguments to a function
}
參考摺疊僅適用於格式爲「T &&」的情況。 ''C &&''總是指定一個右值引用(如'std :: vector &&') –
@AndyProwl:或者當表單是'auto &&'時。 – Nawaz
@AndyProwl是的,但沒有崩潰我無法解決第二個問題! –