MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / takeOwnership

Method takeOwnership

tests/catch.hpp:11219–11226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11217 }
11218
11219 void StringRef::takeOwnership() {
11220 if( !isOwned() ) {
11221 m_data = new char[m_size+1];
11222 memcpy( m_data, m_start, m_size );
11223 m_data[m_size] = '\0';
11224 m_start = m_data;
11225 }
11226 }
11227 auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef {
11228 if( start < m_size )
11229 return StringRef( m_start+start, size );

Callers 1

c_strMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected