edponce commented on a change in pull request #10349:
URL: https://github.com/apache/arrow/pull/10349#discussion_r703916892
##########
File path: cpp/src/arrow/util/map.h
##########
@@ -17,13 +17,21 @@
#pragma once
+#include <type_traits>
#include <utility>
#include "arrow/result.h"
namespace arrow {
namespace internal {
+/// Functor to make enums hashable.
+template <typename T, typename R = typename std::underlying_type<T>::type,
+ typename = std::enable_if<std::is_enum<T>::value>>
+struct EnumHash {
+ R operator()(T val) const { return static_cast<R>(val); }
+};
Review comment:
It was used for `std::unordered_map<RoundMode, ...>` but this map was
removed and converted into a switch statement inside of a function. Also, it is
used in the `scalar_arithmetic_test.cc` but it will not be used as maps will be
converted to `std::vector<std::pair<...>>`.
--
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]