tweak StringOutputStream use
auto str = StringOutputStream()(bla) use form was not doing copy elision or move, but copy
This commit is contained in:
@@ -153,3 +153,10 @@ template<typename T>
|
||||
inline StringOutputStream& operator<<( StringOutputStream& ostream, const T& t ){
|
||||
return ostream_write( ostream, t );
|
||||
}
|
||||
|
||||
template<std::size_t capacity = 256, typename ... Args>
|
||||
StringOutputStream StringStream( Args&& ... args ){
|
||||
StringOutputStream str( capacity );
|
||||
( str << ... << std::forward<Args>( args ) );
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user