summaryrefslogtreecommitdiff
path: root/modules/core/tests/templates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/tests/templates.cpp')
-rw-r--r--modules/core/tests/templates.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/modules/core/tests/templates.cpp b/modules/core/tests/templates.cpp
index 2a069a6..95203f9 100644
--- a/modules/core/tests/templates.cpp
+++ b/modules/core/tests/templates.cpp
@@ -3,18 +3,25 @@
#include "../c++/test/suite.hpp"
namespace {
-struct Foo{};
-
-struct Bar{};
-struct Baz{};
-
-SAW_TEST("Templates/Reduce tmpl_group<T...>"){
+SAW_TEST("Templates/Group Reduction"){
using namespace saw;
- using DuplGrp = tmpl_group<Bar,Baz,Baz,Bar,Foo,Bar,Baz,Bar,Bar>;
+ struct foo {
+ std::string name = "foo";
+ };
+ struct bar {
+ std::string name = "bar";
+ };
+ struct baz {
+ std::string name = "baz";
+ };
- using UniqGrp = tmpl_group<Foo,Baz,Bar>;
+ using grp = tmpl_group<foo, bar, baz, foo, bar, foo>;
+ using red_grp = tmpl_group<baz, bar, foo>;
- SAW_EXPECT((std::is_same_v<DuplGrp,UniqGrp>), "Expected Uniquess Reduction");
+ using alg_red_grp = tmpl_reduce<grp>::type;
+
+ static_assert(std::is_same_v<alg_red_grp, red_grp>, "Should be same type");
+ SAW_EXPECT((std::is_same_v<alg_red_grp, red_grp>), "Should be same type");
}
}