Skip to content

Commit 3979374

Browse files
committed
improve cursor conditions
1 parent 4c786be commit 3979374

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,17 @@ struct WritingCursor {
135135

136136
private:
137137
template <typename A>
138+
requires requires { &A::globalIndex; }
138139
static decltype(auto) extract(A const& arg)
139140
{
140-
if constexpr (requires(T t) { t.globalIndex(); }) {
141-
return arg.globalIndex();
142-
} else {
143-
static_assert(!framework::has_type<A>(typename persistent_table_t::persistent_columns_t{}), "Argument type mismatch");
144-
return arg;
145-
}
141+
return arg.globalIndex();
142+
}
143+
144+
template <typename A>
145+
requires (framework::has_type<A>(typename persistent_table_t::persistent_columns_t{}))
146+
static decltype(auto) extract(A const& arg)
147+
{
148+
return arg;
146149
}
147150

148151
/// The table builder which actually performs the

0 commit comments

Comments
 (0)