내가 비주얼 스튜디오 2017에서 컴파일 Solipsis을 얻으려고 (그것은 VS 2005 작성되었습니다)istream 추출 연산자 >>는 무엇을 반환합니까?
이 코드가 시도되고 있는지 알 수 없습니다
template<typename T>
bool from_string(const char* Str, T & Dest)
{
// créer un flux à partir de la chaîne donnée
std::istringstream iss(Str);
// tenter la conversion vers Dest
return iss >> Dest != 0;
}
그것은 도착 (추출되지 비트 시프트로써 사용될 경우) '>>'연산자의 반환 값이 무엇인지, 인간의 언어로 다음 오류
1>c:\users\root\source\repos\solipsis3d\sources\modelers\mdlrtools\include\SolipsisErrorHandler.h(91): error C2678: binary '!=': no operator found which takes a left-hand operand of type 'std::basic_istream<char,std::char_traits<char>>' (or there is no acceptable conversion)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\exception(347): note: could be 'bool std::operator !=(const std::exception_ptr &,const std::exception_ptr &) throw()' [found using argument-dependent lookup]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\exception(352): note: or 'bool std::operator !=(std::nullptr_t,const std::exception_ptr &) throw()' [found using argument-dependent lookup]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\exception(357): note: or 'bool std::operator !=(const std::exception_ptr &,std::nullptr_t) throw()' [found using argument-dependent lookup]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\system_error(379): note: or 'bool std::operator !=(const std::error_code &,const std::error_code &) noexcept' [found using argument-dependent lookup]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\system_error(384): note: or 'bool std::operator !=(const std::error_code &,const std::error_condition &) noexcept' [found using argument-dependent lookup]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\system_error(389): note: or 'bool std::operator !=(const std::error_condition &,const std::error_code &) noexcept' [found using argument-dependent lookup]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\system_error(394): note: or 'bool std::operator !=(const std::error_condition &,const std::error_condition &) noexcept' [found using argument-dependent lookup]
1>c:\users\root\source\repos\solipsis3d\sources\modelers\mdlrtools\include\SolipsisErrorHandler.h(91): note: or 'built-in C++ operator!=(bool, int)'
1>c:\users\root\source\repos\solipsis3d\sources\modelers\mdlrtools\include\SolipsisErrorHandler.h(91): note: while trying to match the argument list '(std::basic_istream<char,std::char_traits<char>>, int)'
1>src\Object3D.cpp(220): note: see reference to function template instantiation 'bool Solipsis::from_string<bool>(const char *,T &)' being compiled
1> with
1> [
1> T=bool
1> ]
1>c:\users\root\source\repos\solipsis3d\sources\modelers\mdlrtools\include\SolipsisErrorHandler.h(91): error C2446: '!=': no conversion from 'int' to 'std::basic_istream<char,std::char_traits<char>>'
1>c:\users\root\source\repos\solipsis3d\sources\modelers\mdlrtools\include\SolipsisErrorHandler.h(91): note: Constructor for class 'std::basic_istream<char,std::char_traits<char>>' is declared 'explicit'
1>SolipsisErrorHandler.cpp
? VS 2005 이후로 코드 스 니펫이 작동하지 않는 이유는 무엇입니까?
[표준 : 이건 basic_istream :: 연산자 >> (http://en.cppreference.com/w/cpp/io/basic_istream/operator_gtgt가) –
당신이 어떤 연산자 >> 반환을 요구하거나입니다 있습니까 그 기능이 무엇인지 묻는다. –
[좋은 질문하기] (https://stackoverflow.com/help/how-to-ask)를 참조하십시오. 질문의 이름을 바꾸는 것이 좋습니다. – viddik13