Skip to content

Commit df6723d

Browse files
committed
New version of is_tuple to pass broken tests
1 parent 725a37d commit df6723d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

include/cadmium/concept/concept_helpers.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ namespace cadmium {
4747
};
4848

4949
namespace { //details
50-
template<typename... Ts>
51-
constexpr bool is_tuple(std::tuple<Ts...>) {
52-
return true;
50+
template<typename, template<typename...> class>
51+
struct is_specialization : std::false_type {};
52+
template<template<typename...> class TEMP, typename... ARGS>
53+
struct is_specialization<TEMP<ARGS...>, TEMP>: std::true_type {};
54+
55+
template<typename T>
56+
constexpr bool is_tuple(){
57+
return is_specialization<T, std::tuple>::value;
5358
}
54-
59+
5560
template<typename T, int S>
5661
struct check_unique_elem_types_impl {
5762
static constexpr bool value() {

include/cadmium/concept/coupled_model_assert.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace cadmium{
7272
template<typename IN, typename EICs>
7373
constexpr void assert_eic(IN p_in, EICs eics) {
7474
assert_each_eic<IN, EICs, std::tuple_size<EICs>::value>::value();//check couple individually
75-
static_assert(is_tuple(eics), "EIC is not a tuple");
75+
static_assert(is_tuple<EICs>(), "EIC is not a tuple");
7676
}
7777

7878
//static assert over the EOC descriptions
@@ -108,7 +108,7 @@ namespace cadmium{
108108
template<typename OUT, typename EOCs>
109109
constexpr void assert_eoc(OUT p_out, EOCs eocs) {
110110
assert_each_eoc<OUT, EOCs, std::tuple_size<EOCs>::value>::value();//check couple individually
111-
static_assert(is_tuple(eocs), "EOC is not a tuple");
111+
static_assert(is_tuple<EOCs>(), "EOC is not a tuple");
112112
}
113113

114114
//static assert over the IC descriptions
@@ -149,7 +149,7 @@ namespace cadmium{
149149
template<typename ICs>
150150
constexpr void assert_ic(ICs ics) {
151151
assert_each_ic<ICs, std::tuple_size<ICs>::value>::value();//check couple individually
152-
static_assert(is_tuple(ics), "ICs is not a tuple");
152+
static_assert(is_tuple<ICs>(), "ICs is not a tuple");
153153
}
154154

155155

0 commit comments

Comments
 (0)