aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/delete_nth.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-10 18:40:05 +0100
committerAdrian Kummerlaender2015-02-10 18:40:05 +0100
commitf1268ca3bf10ab136bafbd63894ce12353fa8690 (patch)
tree047add598bc7ac82de9931ebd9b0780cf2dfbbb4 /src/list/operation/delete_nth.h
parent8893f72598040681aec3de58740212c0003fc65b (diff)
downloadTypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.tar
TypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.tar.gz
TypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.tar.bz2
TypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.tar.lz
TypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.tar.xz
TypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.tar.zst
TypeAsValue-f1268ca3bf10ab136bafbd63894ce12353fa8690.zip
Moved `Sort` list index deletion into `DeleteNth` function
* as it is commonly required functionality and as such should be provided by this library
Diffstat (limited to 'src/list/operation/delete_nth.h')
-rw-r--r--src/list/operation/delete_nth.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/list/operation/delete_nth.h b/src/list/operation/delete_nth.h
new file mode 100644
index 0000000..03df12a
--- /dev/null
+++ b/src/list/operation/delete_nth.h
@@ -0,0 +1,21 @@
+#ifndef TYPEASVALUE_SRC_LIST_OPERATION_DELETE_NTH_H_
+#define TYPEASVALUE_SRC_LIST_OPERATION_DELETE_NTH_H_
+
+#include "list/operation/append.h"
+#include "list/operation/take.h"
+#include "list/operation/drop.h"
+
+namespace tav {
+
+template <
+ typename Index,
+ typename List
+>
+using DeleteNth = Append<
+ typename Take<Index, List>::type,
+ typename Drop<Add<Index, Size<1>>, List>::type
+>;
+
+}
+
+#endif // TYPEASVALUE_SRC_LIST_OPERATION_DELETE_NTH_H_