use fold expression, forwarding reference
This commit is contained in:
parent
abc666ab7f
commit
b9d5f091e0
|
|
@ -113,10 +113,9 @@ std::size_t write( const char* buffer, std::size_t length ){
|
|||
}
|
||||
|
||||
template<typename ... Args>
|
||||
StringOutputStream& operator()( const Args& ... args ){
|
||||
StringOutputStream& operator()( Args&& ... args ){
|
||||
clear();
|
||||
using expander = int[];
|
||||
(void)expander{ 0, ( (void)( *this << args ), 0 ) ... };
|
||||
( *this << ... << std::forward<Args>( args ) );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,9 @@ public:
|
|||
}
|
||||
|
||||
template<typename ... Args>
|
||||
StringFixedSize& operator()( const Args& ... args ){
|
||||
StringFixedSize& operator()( Args&& ... args ){
|
||||
clear();
|
||||
using expander = int[];
|
||||
(void)expander{ 0, ( (void)( *this << args ), 0 ) ... };
|
||||
( *this << ... << std::forward<Args>( args ) );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user