/*************************************************************************** * Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht * * Copyright (c) QuantStack * * * * Distributed under the terms of the BSD 3-Clause License. * * * * The full license is in the file LICENSE, distributed with this software. * ****************************************************************************/ #ifndef XTENSOR_EXPRESSION_TRAITS_HPP #define XTENSOR_EXPRESSION_TRAITS_HPP #include "xexpression.hpp" namespace xt { /*************** * xvalue_type * ***************/ namespace detail { template struct xvalue_type_impl { using type = E; }; template struct xvalue_type_impl::value>> { using type = typename E::value_type; }; } template using xvalue_type = detail::xvalue_type_impl; template using xvalue_type_t = typename xvalue_type::type; /********************* * common_value_type * *********************/ template struct common_value_type { using type = std::common_type_t::value_type...>; }; template using common_value_type_t = typename common_value_type::type; /******************** * common_size_type * ********************/ template struct common_size_type { using type = std::common_type_t; }; template <> struct common_size_type<> { using type = std::size_t; }; template using common_size_type_t = typename common_size_type::type; /************************** * common_difference type * **************************/ template struct common_difference_type { using type = std::common_type_t; }; template <> struct common_difference_type<> { using type = std::ptrdiff_t; }; template using common_difference_type_t = typename common_difference_type::type; /****************** * temporary_type * ******************/ namespace detail { template struct xtype_for_shape { template using type = xarray; }; #if defined(__GNUC__) && (__GNUC__ > 6) #if __cplusplus == 201703L template