We can improve performance by using a char buffer instead of
basic_string. The loop bound already means we can't overflow the buffer,
and we don't need to keep writing a null character after every character
written to the buffer.
We could just use basic_string::resize(N) to zero-init the whole string,
then overwrite those chars. But that zero-init of all N chars would be
wasted in the case where we are writing to a bitset<N> with large N, but
only end up extracting one or two chars from the stream.
With this change we just use buffer of uninitialized chars. For a
small-ish bitset (currently <= 256) we can improve performance further
by using alloca instead of the heap.
libstdc++-v3/ChangeLog:
* include/std/bitset (operator>>): Use a simple buffer instead
of std::basic_string.