BAN: implement basic swap
This will be improved, currently just works on general type T and moves values between arguments.
This commit is contained in:
parent
efd8be8207
commit
a872efdef2
|
@ -0,0 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <BAN/Move.h>
|
||||
|
||||
namespace BAN
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
void swap(T& lhs, T& rhs)
|
||||
{
|
||||
T tmp = move(lhs);
|
||||
lhs = move(rhs);
|
||||
rhs = move(tmp);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue