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:
Bananymous 2023-12-07 08:59:28 +02:00
parent efd8be8207
commit a872efdef2
1 changed files with 16 additions and 0 deletions

16
BAN/include/BAN/Swap.h Normal file
View 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);
}
}