aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/nth.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-09 15:44:46 +0100
committerAdrian Kummerlaender2015-02-09 15:44:46 +0100
commit262806540c6eaf0dc45794cdf8f5f0404df10c79 (patch)
treedb51e0daaf5ba4c063151df1f3d7ea26c532b4e4 /src/list/operation/nth.h
parent0d194826e1661a0b945211bccb387df0b7d89066 (diff)
downloadTypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.tar
TypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.tar.gz
TypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.tar.bz2
TypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.tar.lz
TypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.tar.xz
TypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.tar.zst
TypeAsValue-262806540c6eaf0dc45794cdf8f5f0404df10c79.zip
Added `First`, `Second` and `Third` aliae for `Nth`
* increases expressiveness in some contexts * renamed `Partition` list template parameter to avoid confusion
Diffstat (limited to 'src/list/operation/nth.h')
-rw-r--r--src/list/operation/nth.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/list/operation/nth.h b/src/list/operation/nth.h
index 6020dcb..076add4 100644
--- a/src/list/operation/nth.h
+++ b/src/list/operation/nth.h
@@ -26,6 +26,20 @@ struct Nth<Index, void> {
typedef void type;
};
+template <>
+struct Nth<Size<0>, void> {
+ typedef void type;
+};
+
+template <typename List>
+using First = typename Nth<Size<0>, List>::type;
+
+template <typename List>
+using Second = typename Nth<Size<1>, List>::type;
+
+template <typename List>
+using Third = typename Nth<Size<2>, List>::type;
+
}
#endif // TYPEASVALUE_SRC_LIST_OPERATION_NTH_H_