use std::type_traits everywhere

This commit is contained in:
Hans Dembinski
2017-11-06 11:49:47 +01:00
parent 5dee79f556
commit ba274ed04d
4 changed files with 8 additions and 10 deletions

View File

@@ -145,7 +145,7 @@ template <typename T> python::str axis_get_label(const T& t) {
#ifdef HAVE_NUMPY
template <typename Axis> python::object axis_array_interface(const Axis& axis) {
using T = typename decay<decltype(axis[0].lower())>::type;
using T = typename std::decay<decltype(axis[0].lower())>::type;
python::dict d;
auto shape = python::make_tuple(axis.size()+1);
d["shape"] = shape;

View File

@@ -8,7 +8,7 @@
#define _BOOST_HISTOGRAM_PYTHON_UTILITY_HPP_
#include <boost/python/str.hpp>
#include <boost/type_traits.hpp>
#include <type_traits>
#include <stdexcept>
namespace boost {
@@ -16,14 +16,12 @@ namespace python {
template <typename T>
str dtype_typestr() {
str s;
if (is_unsigned<T>::value)
s = "|u";
else if (is_signed<T>::value)
s = "|i";
else if (is_floating_point<T>::value)
if (std::is_floating_point<T>::value)
s = "|f";
else if (std::is_integral<T>::value)
s = std::is_unsigned<T>::value ? "|u" : "|i";
else
throw std::invalid_argument("T must be an arithmetic type");
throw std::invalid_argument("T must be a builtin arithmetic type");
s += str(sizeof(T));
return s;
}