You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/05/08 18:57:09 UTC

[GitHub] [arrow] wesm commented on a change in pull request #7120: ARROW-8727: [C++] Don't require stack allocation of any object to use StringConverter, hide behind ParseValue function

wesm commented on a change in pull request #7120:
URL: https://github.com/apache/arrow/pull/7120#discussion_r422314767



##########
File path: cpp/src/arrow/util/value_parsing.h
##########
@@ -484,6 +455,14 @@ static inline bool ParseHH_MM_SS(const char* s, std::chrono::duration<ts_type>*
 
 }  // namespace detail
 
+/// \brief Attempt to convert a string to the primitive type corresponding to
+/// an Arrow data type
+template <typename T, typename ParseContext = void>
+inline bool ParseValue(const char* s, size_t length, typename T::c_type* out,
+                       const ParseContext* ctx = NULLPTR) {
+  return detail::StringConverter<T>::Convert(s, length, out);
+}
+

Review comment:
       I still really don't like this because you're pushing requirements from a special case onto the general case 




----------------------------------------------------------------
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.

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