Poniższy kod drukuje na mac osx z clang. Wszędzie drukuje (clang, gcc)std :: istringstream >> do podwójnego dziwnego zachowania
#include <iostream>
#include <sstream>
int main() {
std::istringstream iss("5C3");
double n;
iss >> n;
std::cout << n << std::endl;
return 0;
}
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Gdy używam int
drukuje 5 zgodnie z oczekiwaniami ..
Jak operator>> of std::istringstream pracy i dlaczego tak się dzieje? Czy istnieje sposób, aby działał w spójny sposób? (to jest ekstrakt 5)