Is it possible to pass a template template paramater value by universal reference? Consider for example this minimal example for a function (not) working on STL sequences:
#include <iostream>
#include <vector>
template < template<typename,typename> class C, template<typename> class A, typename T >
void func(C<T, A<T>>&& c) {
// usually I'd std::forward here, but let's just use cout...
std::cout << c.size() << "\n";
}
int main (int argc, char const* argv[]) {
func(std::vector<float>(2));
std::vector<float> lv(3);
func(lv);
}
It won't compile since the compiler doesn't know how to bind the l-value ("lv") in the second call to func. I'm a bit lost when it comes to the deduction rules for the type of C. Can anyone enlighten me?
Edit: Although I guess it is not relevant for the question: I used g++ 4.9 and clang 3.5 (both repo HEADs)