summaryrefslogtreecommitdiff
path: root/lib/sorting.hpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-29 19:07:11 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-29 19:07:11 +0100
commit5a0b3927a33807cca4c77c40eb873f8a3b51b0b0 (patch)
tree4af0585ee8f8f468ab10c0a4fe9994fb30b79599 /lib/sorting.hpp
parentDunno how, but some DOS new lines got in here! (diff)
downloadilt-5a0b3927a33807cca4c77c40eb873f8a3b51b0b0.tar.bz2
ilt-5a0b3927a33807cca4c77c40eb873f8a3b51b0b0.tar.xz
ilt-5a0b3927a33807cca4c77c40eb873f8a3b51b0b0.zip
Drop .hpp for header only things
Half of them acquired a .cpp part anyway
Diffstat (limited to 'lib/sorting.hpp')
-rw-r--r--lib/sorting.hpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/sorting.hpp b/lib/sorting.hpp
deleted file mode 100644
index 777de00..0000000
--- a/lib/sorting.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#pragma once
-
-#include <glm/fwd.hpp>
-#include <type_traits>
-
-template<typename T> struct PtrSorter {
- bool
- operator()(const T & a, const T & b) const
- {
- return *a < *b;
- }
-};
-
-template<typename T, auto M> struct PtrMemberSorter : public PtrSorter<T> {
- using MT = std::decay_t<decltype((*T {}).*M)>;
- using is_transparent = MT;
-
- using PtrSorter<T>::operator();
-
- bool
- operator()(const MT & a, const T & b) const
- {
- return a < (*b).*M;
- }
-
- bool
- operator()(const T & a, const MT & b) const
- {
- return (*a).*M < b;
- }
-};
-
-struct CompareBy {
- glm::length_t index;
-
- template<typename T>
- auto
- operator()(const T & a, const T & b) const
- {
- return get(a) < get(b);
- }
-
- template<typename T>
- auto
- get(const T & a) const
- {
- return a[index];
- }
-};