@@ -116,7 +116,8 @@ template <typename Fn, typename... Args>
116116void invoke_visit_fn_impl_ (std::vector<std::string> type_labels, Fn&& fn,
117117 Args&&... args) {
118118 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 ) {
120121 auto type_label = type_labels.front ();
121122 if (type_label == " uint8" ) {
122123 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,
155156 assert (false );
156157 }
157158 } else {
159+ // The next two types are index types, which must be integrals.
158160 auto type_label = type_labels.back ();
159161 type_labels.pop_back ();
160162 if (type_label == " uint8" ) {
@@ -181,15 +183,6 @@ void invoke_visit_fn_impl_(std::vector<std::string> type_labels, Fn&& fn,
181183 } else if (type_label == " int64" ) {
182184 invoke_visit_fn_impl_ (type_labels, std::forward<Fn>(fn), std::int64_t (),
183185 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)...);
193186 } else {
194187 assert (false );
195188 }
0 commit comments