这是一个编译器错误,这段代码不应该编译,它肯定是一个错误,甚至没有警告。如果我删除其中一个X,重载,我正确地得到错误信息。我去了dinkumware.com,并尝试在线编译它。 EDG前端出错。哎呀,即使是VC ++ 7.1 也会出错。我的Borland C ++ Builder 6.0也不想编译它。没有编译器应该。重载会以某种方式混淆VC ++ 8. This is a compiler bug, this code shouldn''t compile, it''s definitely anerror, not even a warning. If I remove one of the "X" overloads, Iproperly get the error message. I went to dinkumware.com, and tried tocompile it online. The EDG front-end gives an error. Heck, even VC++ 7.1gives an error. My Borland C++Builder 6.0 doesn''t want to compile iteither. No compiler should. The overload somehow confuses VC++ 8. 是的,tX在标准C ++中没有意义,但早期版本允许它 表示指向会员。 MS在VC7中修复此问题,但看起来VC8已经在这里遭遇了回归。 - Doug Harrison Visual C ++ MVPYep, t.X has no meaning in Standard C++, but earlier versions allowed it tomean pointer to member. MS fixed this in VC7, but it looks like VC8 hassuffered a regression here.--Doug HarrisonVisual C++ MVP 这篇关于编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 19:25