@@ -116,7 +116,8 @@ template <typename Fn, typename... Args>
116
116
void invoke_visit_fn_impl_ (std::vector<std::string> type_labels, Fn&& fn,
117
117
Args&&... args) {
118
118
if constexpr (sizeof ...(Args) <= 3 ) {
119
- if (type_labels.size () == 1 ) {
119
+ // The first label we consume is the value label
120
+ if (type_labels.size () == 3 ) {
120
121
auto type_label = type_labels.front ();
121
122
if (type_label == " uint8" ) {
122
123
invoke_if_able (std::forward<Fn>(fn), std::uint8_t (),
@@ -155,6 +156,7 @@ void invoke_visit_fn_impl_(std::vector<std::string> type_labels, Fn&& fn,
155
156
assert (false );
156
157
}
157
158
} else {
159
+ // The next two types are index types, which must be integrals.
158
160
auto type_label = type_labels.back ();
159
161
type_labels.pop_back ();
160
162
if (type_label == " uint8" ) {
@@ -181,15 +183,6 @@ void invoke_visit_fn_impl_(std::vector<std::string> type_labels, Fn&& fn,
181
183
} else if (type_label == " int64" ) {
182
184
invoke_visit_fn_impl_ (type_labels, std::forward<Fn>(fn), std::int64_t (),
183
185
std::forward<Args>(args)...);
184
- } else if (type_label == " float32" ) {
185
- invoke_visit_fn_impl_ (type_labels, std::forward<Fn>(fn), float (),
186
- std::forward<Args>(args)...);
187
- } else if (type_label == " float64" ) {
188
- invoke_visit_fn_impl_ (type_labels, std::forward<Fn>(fn), double (),
189
- std::forward<Args>(args)...);
190
- } else if (type_label == " bint8" ) {
191
- invoke_visit_fn_impl_ (type_labels, std::forward<Fn>(fn), bool (),
192
- std::forward<Args>(args)...);
193
186
} else {
194
187
assert (false );
195
188
}
0 commit comments