aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-12 13:36:27 +0100
committerAdrian Kummerlaender2015-02-12 13:36:27 +0100
commit4bb200de716891ed6c9fc182311c02685c8bdfd4 (patch)
tree2f3028ac8023ab588a3f074b8875d1eeecf1ea5c
parentad27a79a2e6bc380e68ec77ae961917a9fb402d3 (diff)
downloadTypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.tar
TypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.tar.gz
TypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.tar.bz2
TypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.tar.lz
TypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.tar.xz
TypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.tar.zst
TypeAsValue-4bb200de716891ed6c9fc182311c02685c8bdfd4.zip
Added `Is` prefix to `EqualValue` and `EqualType`
* analogously to `IsPair`
-rw-r--r--example/prime/prime.cc2
-rw-r--r--src/list/operation/contains.h2
-rw-r--r--src/list/operation/delete.h2
-rw-r--r--src/operation/math.h2
-rw-r--r--src/type.h4
-rw-r--r--test.cc12
6 files changed, 12 insertions, 12 deletions
diff --git a/example/prime/prime.cc b/example/prime/prime.cc
index 3d5cced..e4a58d6 100644
--- a/example/prime/prime.cc
+++ b/example/prime/prime.cc
@@ -18,7 +18,7 @@ template <
typename Candidate,
typename Base
>
-using isMultipleOf = tav::EqualValue<
+using isMultipleOf = tav::IsEqualValue<
tav::Modulo<Candidate, Base>,
tav::Int<0>
>;
diff --git a/src/list/operation/contains.h b/src/list/operation/contains.h
index 458acc0..c58d6ac 100644
--- a/src/list/operation/contains.h
+++ b/src/list/operation/contains.h
@@ -12,7 +12,7 @@ template <
typename List
>
using Contains = Any<
- Apply<EqualValue, _0, Element>::template type,
+ Apply<IsEqualValue, _0, Element>::template type,
List
>;
diff --git a/src/list/operation/delete.h b/src/list/operation/delete.h
index a524667..430336f 100644
--- a/src/list/operation/delete.h
+++ b/src/list/operation/delete.h
@@ -12,7 +12,7 @@ template <
typename List
>
using Delete = Remove<
- Apply<EqualValue, _0, Element>::template type,
+ Apply<IsEqualValue, _0, Element>::template type,
List
>;
diff --git a/src/operation/math.h b/src/operation/math.h
index d855893..e20795b 100644
--- a/src/operation/math.h
+++ b/src/operation/math.h
@@ -55,7 +55,7 @@ using Modulo = std::integral_constant<
>;
template <typename X>
-using Even = EqualValue<
+using Even = IsEqualValue<
Modulo<X, Size<2>>,
Size<0>
>;
diff --git a/src/type.h b/src/type.h
index 9fc30e2..c175c36 100644
--- a/src/type.h
+++ b/src/type.h
@@ -21,7 +21,7 @@ template <
typename X,
typename Y
>
-using EqualType = typename std::is_same<
+using IsEqualType = typename std::is_same<
typename X::value_type,
typename Y::value_type
>::type;
@@ -30,7 +30,7 @@ template <
typename X,
typename Y
>
-using EqualValue = Boolean<X::value == Y::value>;
+using IsEqualValue = Boolean<X::value == Y::value>;
}
diff --git a/test.cc b/test.cc
index 2bf9e09..e89fcb1 100644
--- a/test.cc
+++ b/test.cc
@@ -30,23 +30,23 @@ int main(int, char **) { }
static_assert(
std::is_same<
tav::Boolean<true>,
- tav::EqualType<tav::Int<1>, tav::Int<2>>
+ tav::IsEqualType<tav::Int<1>, tav::Int<2>>
>::value,
- "(EqualType 1 2) != #t"
+ "(IsEqualType 1 2) != #t"
);
static_assert(
std::is_same<
tav::Boolean<false>,
- tav::EqualType<tav::Int<1>, tav::Size<1>>
+ tav::IsEqualType<tav::Int<1>, tav::Size<1>>
>::value,
- "(EqualType (int 1) (size 2)) != #f"
+ "(IsEqualType (int 1) (size 2)) != #f"
);
static_assert(
std::is_same<
tav::Boolean<true>,
- tav::EqualValue<tav::Int<1>, tav::Size<1>>
+ tav::IsEqualValue<tav::Int<1>, tav::Size<1>>
>::value,
"(equal? (int 1) (size 1)) != #t"
);
@@ -54,7 +54,7 @@ static_assert(
static_assert(
std::is_same<
tav::Boolean<false>,
- tav::EqualValue<tav::Int<1>, tav::Int<2>>
+ tav::IsEqualValue<tav::Int<1>, tav::Int<2>>
>::value,
"(equal? 1 2) != #f"
);