今天用 vs2003.net 来编译一下使用 sigslot 1.0.0的小测试程序,发现2个编译错误
d:/src/test/sigslot/sigslot.h(419): error C2146: syntax error : missing ';' before identifier 'const_iterator'
d:/src/test/sigslot/sigslot.h(419): error C2501: 'sigslot::has_slots<mt_policy>::const_iterator' : missing storage-class or type specifiers
把这一行 typedef sender_set::const_iterator const_iterator;
变成 typedef typename sender_set::const_iterator const_iterator;
解决问题。
VS这个类型识别可真够差的,写代码也得多考虑下了
本文介绍在使用Visual Studio 2003编译含有sigslot 1.0.0库的测试程序时遇到的编译错误,并提供了解决方案,通过在类型定义前添加typename关键字解决了编译器类型识别的问题。
318

被折叠的 条评论
为什么被折叠?



