diff --git a/cpp/src/arrow/compute/kernels/gather_internal.h b/cpp/src/arrow/compute/kernels/gather_internal.h index 4c161533a72..de3872bf7c3 100644 --- a/cpp/src/arrow/compute/kernels/gather_internal.h +++ b/cpp/src/arrow/compute/kernels/gather_internal.h @@ -35,6 +35,11 @@ namespace arrow::internal { +template +constexpr int64_t FixedWidthByteOffset(IndexType index, int64_t value_width) { + return static_cast(index) * value_width; +} + // CRTP [1] base class for Gather that provides a gathering loop in terms of // Write*() methods that must be implemented by the derived class. // @@ -185,8 +190,8 @@ class Gather : public GatherBaseCRTP