What the purpose of imbue in C++?

后端 未结 2 510
猫巷女王i
猫巷女王i 2020-12-31 07:38

I\'m working with some code today, and I saw:

extern std::locale g_classicLocale;
class StringStream : public virtual std::ostringstream
{
 public:
        S         


        
2条回答
  •  一整个雨季
    2020-12-31 07:55

    imbue is inherited by std::ostringstream from std::ios_base and it sets the locale of the stream to the specified locale.

    This affects the way the stream prints (and reads) certain things; for instance, setting a French locale will cause the decimal point . to be replaced by ,.

提交回复
热议问题