取消设置所有格式标志

Unsetting all the formatting flags

在 C++ 中使用 unsetf 取消设置所有格式标志是否合法?

或者至少取消所有 basefieldfloatfield 标志是否合法?

例如,什么是定义的行为? std::cout 那个?

确实定义了行为。我在为大整数编写插入运算符时查找了这个。为特定标志提供格式说明符的表格,例如 table 75 (which concerns basefield) or table 76 (floatfield) have a default in any case. See also cppreference/num_put.