When should I concern myself with std::iostream::sentry?

后端 未结 3 552
我寻月下人不归
我寻月下人不归 2021-02-03 22:59

Online references have rather brief and vague descriptions on the purpose of std::iostream::sentry. When should I concern myself with this little critter? If it\'s

3条回答
  •  被撕碎了的回忆
    2021-02-03 23:26

    Formatted input for anything but the basic types (int, double, etc.) doesn't make a lot of sense, and arguably only from them when taken from a non-interactive stream such as an istringstream. So you should probably not be implementing op>> in the first place, and thus not have to worry about sentry objects.

提交回复
热议问题