You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "vyasr (via GitHub)" <gi...@apache.org> on 2024/03/09 00:17:02 UTC

Re: [PR] GH-40252: [C++] Make span SFINAE standards-conforming to enable compilation with nvcc [arrow]

vyasr commented on code in PR #40253:
URL: https://github.com/apache/arrow/pull/40253#discussion_r1518426754


##########
cpp/src/arrow/util/span.h:
##########
@@ -59,12 +59,13 @@ writing code which would break when it is replaced by std::span.)");
   template <
       typename R,
       typename DisableUnlessConstructibleFromDataAndSize =
-          decltype(span<T>(std::data(std::declval<R>()), std::size(std::declval<R>()))),
+          std::enable_if_t<std::is_convertible_v< std::remove_pointer_t<decltype(std::data(std::declval<R&>()))> (*)[],
+                                              T(*)[]>>,
       typename DisableUnlessSimilarTypes = std::enable_if_t<std::is_same_v<
           std::decay_t<std::remove_pointer_t<decltype(std::data(std::declval<R>()))>>,
           std::decay_t<T>>>>
   // NOLINTNEXTLINE runtime/explicit, non-const reference
-  constexpr span(R&& range) : span{std::data(range), std::size(range)} {}
+  constexpr span(R& range) : span{std::data(range), std::size(range)} {}

Review Comment:
   OK I think I've got a working version of this now. No need to change the reference parameter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org