| 3549 | } |
| 3550 | |
| 3551 | Result<std::shared_ptr<DataType>> type_singleton(Type::type id) { |
| 3552 | auto visit = [](auto type) -> Result<std::shared_ptr<DataType>> { |
| 3553 | using T = std::decay_t<decltype(*type)>; |
| 3554 | if constexpr (TypeTraits<T>::is_parameter_free) { |
| 3555 | return TypeTraits<T>::type_singleton(); |
| 3556 | } |
| 3557 | return Status::TypeError("Type ", internal::ToString(T::type_id), |
| 3558 | " is not a parameter-free type"); |
| 3559 | }; |
| 3560 | return VisitTypeId(id, visit); |
| 3561 | } |
| 3562 | |
| 3563 | } // namespace arrow |