| 13759 | std::ostringstream m_referenceStream; // Used for copy state/ flags from |
| 13760 | |
| 13761 | auto add() -> std::size_t { |
| 13762 | if( m_unused.empty() ) { |
| 13763 | m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) ); |
| 13764 | return m_streams.size()-1; |
| 13765 | } |
| 13766 | else { |
| 13767 | auto index = m_unused.back(); |
| 13768 | m_unused.pop_back(); |
| 13769 | return index; |
| 13770 | } |
| 13771 | } |
| 13772 | |
| 13773 | void release( std::size_t index ) { |
| 13774 | m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state |