Commit 7f5dad7d by Wenzel Jakob

Remove usage of C++14 constructs (fixes #1929)

parent f3109d84
...@@ -113,12 +113,12 @@ template <typename T> struct same_size { ...@@ -113,12 +113,12 @@ template <typename T> struct same_size {
template <typename U> using as = bool_constant<sizeof(T) == sizeof(U)>; template <typename U> using as = bool_constant<sizeof(T) == sizeof(U)>;
}; };
template <typename Concrete> constexpr int platform_lookup() { return -1; }
// Lookup a type according to its size, and return a value corresponding to the NumPy typenum. // Lookup a type according to its size, and return a value corresponding to the NumPy typenum.
template <typename Concrete, typename... Check, typename... Int> template <typename Concrete, typename T, typename... Ts, typename... Ints>
constexpr int platform_lookup(Int... codes) { constexpr int platform_lookup(int I, Ints... Is) {
using code_index = std::integral_constant<int, constexpr_first<same_size<Concrete>::template as, Check...>()>; return sizeof(Concrete) == sizeof(T) ? I : platform_lookup<Concrete, Ts...>(Is...);
static_assert(code_index::value != sizeof...(Check), "Unable to match type on this platform");
return std::get<code_index::value>(std::make_tuple(codes...));
} }
struct npy_api { struct npy_api {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment