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:
16
BAN/include/BAN/Swap.h
Normal file
16
BAN/include/BAN/Swap.h
Normal file
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user