| 11053 | std::ostringstream m_referenceStream; // Used for copy state/ flags from |
| 11054 | |
| 11055 | auto add() -> std::size_t { |
| 11056 | if( m_unused.empty() ) { |
| 11057 | m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) ); |
| 11058 | return m_streams.size()-1; |
| 11059 | } |
| 11060 | else { |
| 11061 | auto index = m_unused.back(); |
| 11062 | m_unused.pop_back(); |
| 11063 | return index; |
| 11064 | } |
| 11065 | } |
| 11066 | |
| 11067 | void release( std::size_t index ) { |
| 11068 | m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state |