diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/conditional/if.h | 21 |
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_ |