forked from Dynamitos/Seele
Implementing basic physics
This commit is contained in:
1 parent
3d3e264867
commit
1e04da963d
39 files changed
+1999
-145
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
template <typename K, typename V>
|
||||
struct Pair
|
||||
{
|
||||
public:
|
||||
Pair()
|
||||
: key(K()), value(V())
|
||||
{}
|
||||
Pair(const Pair& other) = default;
|
||||
Pair(Pair&& other) = default;
|
||||
~Pair(){}
|
||||
template<class KeyType>
|
||||
explicit Pair(KeyType&& key)
|
||||
: key(std::forward<KeyType>(key)), value(V())
|
||||
{}
|
||||
template<class KeyType, class ValueType>
|
||||
explicit Pair(KeyType&& key, ValueType&& value)
|
||||
: key(std::forward<KeyType>(key)), value(std::forward<ValueType>(value))
|
||||
{}
|
||||
Pair& operator=(const Pair& other) = default;
|
||||
Pair& operator=(Pair&& other) = default;
|
||||
constexpr friend bool operator<(const Pair& left, const Pair& right)
|
||||
{
|
||||
return left.key < right.key || (!(right.key < left.key) && left.value < right.value);
|
||||
}
|
||||
K key;
|
||||
V value;
|
||||
};
|
||||
} // namespace Seele
|
||||
Reference in new issue
Block a user