| 13520 | std::ostringstream m_referenceStream; // Used for copy state/ flags from |
| 13521 | |
| 13522 | auto add() -> std::size_t { |
| 13523 | if( m_unused.empty() ) { |
| 13524 | m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) ); |
| 13525 | return m_streams.size()-1; |
| 13526 | } |
| 13527 | else { |
| 13528 | auto index = m_unused.back(); |
| 13529 | m_unused.pop_back(); |
| 13530 | return index; |
| 13531 | } |
| 13532 | } |
| 13533 | |
| 13534 | void release( std::size_t index ) { |
| 13535 | m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state |