我试图在另一个函数的尾随返回类型中重用运算符的返回类型,但不幸的是clang不接受它
struct A {
int operator[](int);
auto at(int i) -> decltype((*this)[i]);
};
Clang说我的类没有operator[]。Gcc确实接受了我的代码。我的代码真的是无效的吗?
发布于 2013-01-21 17:44:40
看起来,这是CLang的bug,因为下一段代码
struct A {
int operator[](int);
auto at(int i) -> decltype( this-> operator[]( i ) );
};
也由CLang编译- http://liveworkspace.org/code/2Myghk$6
https://stackoverflow.com/questions/14435619
复制相似问题