我会期待 numpunct
facet 包含有关用于负号的字符的信息。
我能否在语言环境的其他地方找到此信息,还是我必须假设它始终是 '-'
?
最佳答案
如果我们看num_put::put
对于 showpos
它声明
For both integer and floating-point types, if
showpos
is set, the modifier+
is prepended
所以这让我相信 +
将始终用于表示正数
integer ::= [sign] units sign ::= plusminus plusminus ::= '+' | '-'
我的意思是它将始终使用 -
作为负数,如果为正则使用 +
并且 showpos
为 真
。如果不是这样的话,我希望它会像
integer ::= [sign] units sign ::= plusminus plusminus ::= plus | minus
关于c++ - 语言环境是否有一个定义负号的 Facet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50157641/