Implementing basic physics

This commit is contained in:
Dynamitos committed 2022-11-29 16:34:42 +01:00
1 parent 3d3e264867
commit 1e04da963d
39 files changed
+1999 -145

No files matched your search

+32
View File
@@ -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