C++ C++;:转发模板成员函数调用失败

C++ C++;:转发模板成员函数调用失败,c++,templates,c++11,template-meta-programming,C++,Templates,C++11,Template Meta Programming,假设我有一个模板类TemplateClass,带有一个模板函数templatfcn,如下所示: template <typename T> struct TemplateClass { template <bool Bool> void templFcn(int i) { } }; void test() { TemplateClass<float> v; v.templFcn<true>(0); // Compiles ok. }

假设我有一个模板类
TemplateClass
,带有一个模板函数
templatfcn
,如下所示:

template <typename T>
struct TemplateClass {
  template <bool Bool> void templFcn(int i) { }
};
void test() {
  TemplateClass<float> v;
  v.templFcn<true>(0);  // Compiles ok.
}
clang++导致的编译器错误:

test.cc:16:5: error: reference to non-static member function must be called
  v.templFcn<Bool>(0);
  ~~^~~~~~~~
test.cc:21:3: note: in instantiation of function template specialization
      'forward<float, TemplateClass, true>' requested here
  forward<float,TemplateClass,true>(v);
  ^
test.cc:3:29: note: possible target for call
  template <bool Bool> void templFcn(int i) { }
                        ^
1 error generated.
test.cc:16:5:错误:必须调用对非静态成员函数的引用
v、 tempfcn(0);
~~^~~~~~~~
test.cc:21:3:注意:在函数模板专门化的实例化中
此处请求“转发”
转发(v);
^
test.cc:3:29:注意:可能的呼叫目标
模板void templafcn(inti){}
^
生成1个错误。
有人能解释为什么这种模板转发在这种情况下失败吗?有什么办法可以绕过它吗?谢谢

v.template templatfcn(0);//编译器错误,第16行(见下文)
v.template templFcn<Bool>(0); // Compiler error, Line 16 (see below)
从属从句需要消除歧义,因此它知道

v.template templFcn<Bool>(0); // Compiler error, Line 16 (see below)