Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove operator>> for istream >> setfill(c) #3725

Merged
merged 6 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions stl/inc/iomanip
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ template <class _Elem>
struct _Fillobj { // store fill character
_Fillobj(_Elem _Ch) : _Fill(_Ch) {}

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;
}

template <class _Elem2, class _Traits>
friend basic_ostream<_Elem2, _Traits>& operator<<(basic_ostream<_Elem2, _Traits>& _Ostr, const _Fillobj& _Manip) {
// set fill character in output stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,12 @@ void iomanip_test_impl(IoManip iom) {
iomanip_test_impl(iom, iom);
}

template <typename IoManip>
void iomanip_test_impl_for_setfill(IoManip in) {
stringstream ss{};
ss << in;
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
}

void iomanip_test() {
auto sf = setfill('*');
long double money = 123.45;
Expand All @@ -591,7 +597,7 @@ void iomanip_test() {
localtime_s(&time, &t);
string str = "string with \" quotes ";

iomanip_test_impl(sf);
iomanip_test_impl_for_setfill(sf);
iomanip_test_impl(put_money(money), get_money(money));
iomanip_test_impl(put_time(&time, "%c %Z"), get_time(&time, "%c %Z"));
iomanip_test_impl(quoted(str.c_str()), quoted(str));
Expand Down