Buffers - append() method
This commit is contained in:
parent
6f52668540
commit
d2122aff38
2 changed files with 15 additions and 0 deletions
include/ebcl/inline
|
@ -260,6 +260,20 @@ inline T_Buffer< T >& T_Buffer< T >::copyAll( T const* data )
|
|||
return *this;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
inline T_Buffer< T >& T_Buffer< T >::append(
|
||||
T const* data ,
|
||||
size_t size )
|
||||
{
|
||||
if ( size != 0 ) {
|
||||
const auto os{ size_ };
|
||||
resize( os + size );
|
||||
memcpy( data_ + os * sizeof( T ) ,
|
||||
data , size * sizeof( T ) );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_EBCL_INLINE_BUFFERS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue