According to the standard(this version), std::setfill is only for ostreams. Therefore, istream >> setfill(c) has no well-defined meaning and can lead to confusion.

The following piece of code should get removed.
|
template <class _Elem2, class _Traits>
|
|
friend basic_istream<_Elem2, _Traits>& operator>>(basic_istream<_Elem2, _Traits>& _Istr, const _Fillobj& _Manip) {
|
|
// set fill character in input stream
|
|
static_assert(is_same_v<_Elem, _Elem2>, "wrong character type for setfill");
|
|
|
|
_Istr.fill(_Manip._Fill);
|
|
return _Istr;
|
|
}
|
According to the standard(this version),

std::setfillis only for ostreams. Therefore,istream >> setfill(c)has no well-defined meaning and can lead to confusion.The following piece of code should get removed.
STL/stl/inc/iomanip
Lines 28 to 35 in a621095