Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-39333: [C++] Don't use "if constexpr" in lambda (apache#39334)
### Rationale for this change It seems that it's not portable. At least it doesn't work as expected with Visual Studio 2017: C:/arrow/cpp/src/arrow/array/array_nested.cc(291): error C2065: 'validity': undeclared identifier (compiling source file C:\arrow-build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_0_cxx.cxx) [C:\arrow-build\src\arrow\arrow_shared.vcxproj] C:/arrow/cpp/src/arrow/array/array_nested.cc(660): note: see reference to function template instantiation 'arrow::Result<std::shared_ptr<arrow::Array>> arrow::`anonymous-namespace'::FlattenListViewArray<arrow::ListViewArray,false>(const ListViewArrayT &,arrow::MemoryPool *)' being compiled with [ ListViewArrayT=arrow::ListViewArray ] (compiling source file C:\arrow-build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_0_cxx.cxx) memory_pool.cc C:/arrow/cpp/src/arrow/array/array_nested.cc(291): error C2065: 'list_view_array_offset': undeclared identifier (compiling source file C:\arrow-build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_0_cxx.cxx) [C:\arrow-build\src\arrow\arrow_shared.vcxproj] ### What changes are included in this PR? Avoid "if constexpr" in lambda. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39333 Lead-authored-by: Antoine Pitrou <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
- Loading branch information