// Copyright 2015-2016 Hans Dembinski // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef _BOOST_HISTOGRAM_PYTHON_UTILITY_HPP_ #define _BOOST_HISTOGRAM_PYTHON_UTILITY_HPP_ #include #include #include namespace boost { namespace python { template str dtype_typestr() { str s; if (std::is_floating_point::value) s = "|f"; else if (std::is_integral::value) s = std::is_unsigned::value ? "|u" : "|i"; else throw std::invalid_argument("T must be a builtin arithmetic type"); s += str(sizeof(T)); return s; } } // python } // boost #endif