我希望使用一组用C++编写的库和英特尔编译器.我附上了演示问题的示例代码.库中有很多地方使用'using'指令和部分重载(例如,我想从基类中使用foo(void)方法,但在派生类中重新实现第二个版本fo foo) .gcc没有问题,但英特尔确实如此.
#include <iostream>
template <class F>
struct Interface
{
static const F f=10;
};
template <class F>
struct Base : public Interface<F>
{
void foo (void) { std::cout << "void" << std::endl; }
template <class FF>
void foo (Interface<FF> &ii) { std::cout << "F : " << ii.f << std::endl; }
};
template <class F,int i>
struct Derived : public Base<F>
{
// void foo (void) { Base<F>::foo(); } // works fine
using Base<F>::foo; // gives error
template …Run Code Online (Sandbox Code Playgroud)