我有一个需要使用GCC-4.4.7和GCC-4.9.0进行编译的项目。 我们使用的代码将模板类模板参数传递给另一个类。虽然代码在GCC-4.9.0上编译得很好,但它在GCC-4.4.7上失败。 以下是错误的再现: #include <iostream>
using namespace std;
struct E
{
int a;
E(int b) : a(b) {}
考虑这两个模板功能: template<typename T>
void foo(T&& bar) {
// do stuff with bar, which may or may not be an instance of a templated class
}
template<typename U, template<typename> class T>
void foo