3

参照の折りたたみが適用されない理由

template<typename T, template<typename> class C>
void f(C<T> && x); // x declaration is an rvalue!

const lvalue ref、lvalue ref、rvalue ref のすべての組み合わせのオーバーロードを回避するにはどうすればよいですか?

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
}
4

1 に答える 1