diff options
author | Adrian Kummerlaender | 2015-01-19 17:23:29 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2015-01-19 17:23:29 +0100 |
commit | 17a62b7627551243419d0a85c611eec7e6581e7b (patch) | |
tree | e7df53e93686777c858bc0b1d2dd611953c13268 /src | |
parent | 3cac56267edfbfd26e203ad674b9b8e74e44b14e (diff) | |
download | TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.tar TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.tar.gz TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.tar.bz2 TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.tar.lz TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.tar.xz TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.tar.zst TypeAsValue-17a62b7627551243419d0a85c611eec7e6581e7b.zip |
Moved `Odd` helper into math operation header
* it may be useful for more than test cases
Diffstat (limited to 'src')
-rw-r--r-- | src/operation/math.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/operation/math.h b/src/operation/math.h index fd6e031..b06eb35 100644 --- a/src/operation/math.h +++ b/src/operation/math.h @@ -41,6 +41,12 @@ using Divide = typename std::integral_constant< X::value / Y::value >::type; +template <typename X> +using Even = Boolean<(X::value % 2 == 0)>; + +template <typename X> +using Odd = Boolean<!Even<X>::value>; + } #endif // TYPEASVALUE_SRC_OPERATION_MATH_H_ |