Skip to content

Commit 69b6499

Browse files
committed
Using universal references in logging templates.
1 parent 44297c6 commit 69b6499

File tree

7 files changed

+9
-3
lines changed

7 files changed

+9
-3
lines changed

include/network/logging/logging.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class log_record
4343
}
4444

4545
template< typename TypeOfSomething >
46-
log_record& write( const TypeOfSomething& something ) // THINK: use universal references?
46+
log_record& write( TypeOfSomething&& something )
4747
{
4848
m_text_stream << something;
4949
return *this;
@@ -61,9 +61,9 @@ class log_record
6161
};
6262

6363
template< typename TypeOfSomething >
64-
inline log_record& operator<<( log_record& log, const TypeOfSomething& something ) // THINK: use universal references?
64+
inline log_record& operator<<( log_record& log, TypeOfSomething&& something )
6565
{
66-
return log.write( something );
66+
return log.write( std::forward<TypeOfSomething>(something) );
6767
}
6868

6969
}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��

0 commit comments

Comments
 (0)