C++ Logo

std-proposals

Advanced search

Add std::basic_ios::setfail() setter function

From: Tomek Rożen <tomek.rozen_at_[hidden]>
Date: Fri, 25 Oct 2019 14:27:05 +0200
Hi,

I have been creating several operator>>(istream&...) lately. When parsing
fails the failbit flag is set:
    is.setstate(std::ios_base::failbit);
It seems quite verbose, a more convenient way would be just:
    is.setfail();

Do you think it's something worth considering?

Thanks,
Tomek

Received on 2019-10-25 07:29:32