Is this implementation specific or do standards offer a default fill character for threads?
Code example:
#include <iostream> #include <iomanip> #include <sstream> int main () { std::stringstream stream; stream << std::setw( 10 ) << 25 << std::endl; std::cout << stream.str() << std::endl; }
With clang++ --stdlib=libstdc++
$ clang++ --stdlib=libstdc++ test.cpp $ ./a.out | hexdump 0000000 20 20 20 20 20 20 20 20 32 35 0a 0a 000000c $
With clang++ --stdlib=libc++
$ clang++ --stdlib=libc++ test.cpp $ ./a.out | hexdump 0000000 ff ff ff ff ff ff ff ff 32 35 0a 0a 000000c
Version
$ clang++ --version Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.5.0 Thread model: posix
I managed to fix it with std::setfill(' ') , but I'm curious to know if this is a clang error.
c ++ clang ++ stringstream libc ++ setw
Vikas
source share