Skip to content

Commit 7f5dad7

Browse files
committed
Remove usage of C++14 constructs (fixes pybind#1929)
1 parent f3109d8 commit 7f5dad7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/pybind11/numpy.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ template <typename T> struct same_size {
113113
template <typename U> using as = bool_constant<sizeof(T) == sizeof(U)>;
114114
};
115115

116+
template <typename Concrete> constexpr int platform_lookup() { return -1; }
117+
116118
// Lookup a type according to its size, and return a value corresponding to the NumPy typenum.
117-
template <typename Concrete, typename... Check, typename... Int>
118-
constexpr int platform_lookup(Int... codes) {
119-
using code_index = std::integral_constant<int, constexpr_first<same_size<Concrete>::template as, Check...>()>;
120-
static_assert(code_index::value != sizeof...(Check), "Unable to match type on this platform");
121-
return std::get<code_index::value>(std::make_tuple(codes...));
119+
template <typename Concrete, typename T, typename... Ts, typename... Ints>
120+
constexpr int platform_lookup(int I, Ints... Is) {
121+
return sizeof(Concrete) == sizeof(T) ? I : platform_lookup<Concrete, Ts...>(Is...);
122122
}
123123

124124
struct npy_api {

0 commit comments

Comments
 (0)