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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to