| 13746 | std::ostringstream m_referenceStream; // Used for copy state/ flags from |
| 13747 | |
| 13748 | auto add() -> std::size_t { |
| 13749 | if( m_unused.empty() ) { |
| 13750 | m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) ); |
| 13751 | return m_streams.size()-1; |
| 13752 | } |
| 13753 | else { |
| 13754 | auto index = m_unused.back(); |
| 13755 | m_unused.pop_back(); |
| 13756 | return index; |
| 13757 | } |
| 13758 | } |
| 13759 | |
| 13760 | void release( std::size_t index ) { |
| 13761 | m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state |