1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\list(1194): error C2451: conditional expression of type 'void' is illegal
1> Expressions of type void cannot be converted to other types
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\list(1188) : while compiling class template member function 'void std::list<_Ty>::remove(const _Ty &)'
1> with
1> [
1> _Ty=ServerLoginResponseCallback
1> ]
1> c:\users\shawn\edu\csclient\ConfigurationServerClient.h(56) : see reference to class template instantiation 'std::list<_Ty>' being compiled
1> with
1> [
1> _Ty=ServerLoginResponseCallback
1> ]
這裏是產生錯誤代碼......MSVC 2010個模板編譯問題
typedef std::shared_ptr<protocols::ServerLoginResponse> ServerLoginResponsePtr;
typedef std::function<void (ServerLoginResponsePtr)> ServerLoginResponseCallback;
typedef std::list<ServerLoginResponseCallback> ServerLoginResponseCallbackList;
因此,我們必須返回void,並且類型的shared_ptr的參數仿函數列表。有誰知道爲什麼MSVC編譯器有問題嗎?
的錯誤信息是不從三個typedef中,它呢?他們沒有實例化std :: list << ServerLoginResponseCallback> :: remove(ServerLoginResponseCallback const&);' – MSalters 2010-07-28 09:03:49