Should this instead be if (__n == 0)? Can width() ever return a negative number? cppreference says this about streamsize:
I couldn't find a matching statement in the standard, however there's this footnote in 30.5.2:
This does not clearly say that negative values are never used, but it does suggest it. Maybe it's safer to still use __n <= 0.