aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-01-16 20:13:55 +0100
committerAdrian Kummerlaender2015-01-16 20:13:55 +0100
commitf751632317a8cfb8474645e5964008bc7b6b6d90 (patch)
tree9b114e425a2f753ad8ac4645528a38bc64c08b9c /src
parent5a9e048c1efc3d0697debf968b4aeb056c04c391 (diff)
downloadTypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.tar
TypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.tar.gz
TypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.tar.bz2
TypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.tar.lz
TypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.tar.xz
TypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.tar.zst
TypeAsValue-f751632317a8cfb8474645e5964008bc7b6b6d90.zip
Implemented `tav::If` as `std::conditional` wrapper
Diffstat (limited to 'src')
-rw-r--r--src/conditional/if.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/conditional/if.h b/src/conditional/if.h
new file mode 100644
index 0000000..29aa6f0
--- /dev/null
+++ b/src/conditional/if.h
@@ -0,0 +1,21 @@
+#ifndef TYPEASVALUE_SRC_CONDITIONAL_IF_H_
+#define TYPEASVALUE_SRC_CONDITIONAL_IF_H_
+
+#include <type_traits>
+
+namespace tav {
+
+template <
+ bool Condition,
+ typename IfBranch,
+ typename ElseBranch
+>
+using If = typename std::conditional<
+ Condition,
+ IfBranch,
+ ElseBranch
+>::type;
+
+}
+
+#endif // TYPEASVALUE_SRC_CONDITIONAL_IF_H_