Safely overloading stream operator>>

前端 未结 3 1293
忘掉有多难
忘掉有多难 2021-02-01 07:49

There\'s a ton of information available on overloading operator<< to mimic a toString()-style method that converts a complex object to a string.

3条回答
  •  独厮守ぢ
    2021-02-01 08:33

    As for flags, I don't know if there is any standard somewhere, but it is a good idea to reset them.

    Boost has neat raii wrappers for that: IO State Savers

提交回复
热议问题