From f751632317a8cfb8474645e5964008bc7b6b6d90 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 16 Jan 2015 20:13:55 +0100 Subject: Implemented `tav::If` as `std::conditional` wrapper --- src/conditional/if.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/conditional/if.h (limited to 'src') 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 + +namespace tav { + +template < + bool Condition, + typename IfBranch, + typename ElseBranch +> +using If = typename std::conditional< + Condition, + IfBranch, + ElseBranch +>::type; + +} + +#endif // TYPEASVALUE_SRC_CONDITIONAL_IF_H_ -- cgit v1.2.3