MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / add

Method add

unittests/catch.hpp:9501–9511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9499 static StringStreams* s_instance;
9500
9501 auto add() -> std::size_t {
9502 if( m_unused.empty() ) {
9503 m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) );
9504 return m_streams.size()-1;
9505 }
9506 else {
9507 auto index = m_unused.back();
9508 m_unused.pop_back();
9509 return index;
9510 }
9511 }
9512
9513 void release( std::size_t index ) {
9514 m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state

Callers

nothing calls this directly

Calls 4

backMethod · 0.80
pop_backMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected