mirror of
https://github.com/boostorg/uuid.git
synced 2026-01-19 04:42:16 +00:00
Use stream character type when calling to_chars in operator<<.
This avoids potential character code conversion in ostream and instead produces native character type directly in to_chars, which is likely much faster.
This commit is contained in:
@@ -79,7 +79,7 @@ BOOST_CXX14_CONSTEXPR inline Ch* to_chars( uuid const& u, Ch (&buffer)[ 36 ] ) n
|
||||
template<class Ch, class Traits>
|
||||
std::basic_ostream<Ch, Traits>& operator<<( std::basic_ostream<Ch, Traits>& os, uuid const& u )
|
||||
{
|
||||
alignas( 16 ) char tmp[ 37 ];
|
||||
alignas( 16 ) Ch tmp[ 37 ];
|
||||
to_chars( u, tmp );
|
||||
|
||||
os << tmp;
|
||||
|
||||
Reference in New Issue
Block a user