| Server IP : 217.160.0.212 / Your IP : 216.73.216.141 Web Server : Apache System : Linux www 6.18.51-i1-ampere #1196 SMP Fri Sep 11 20:43:55 CEST 2026 aarch64 User : sws1073854427 ( 1073854427) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/pythran/pythonic/utils/ |
Upload File : |
#ifndef PYTHONIC_UTILS_NESTED_CONTAINER_HPP
#define PYTHONIC_UTILS_NESTED_CONTAINER_HPP
#include "pythonic/include/utils/nested_container.hpp"
#include <limits>
#include "pythonic/types/traits.hpp"
#include "pythonic/utils/numpy_traits.hpp"
PYTHONIC_NS_BEGIN
namespace utils
{
template <class T>
long nested_container_size<T>::flat_size(T const &t)
{
return t.size() *
nested_container_size<typename std::conditional<
// If we have a scalar or a complex, we want to stop
// recursion, and then dispatch to bool specialization
types::is_dtype<typename Type::value_type>::value, bool,
typename Type::value_type>::type>::flat_size(*t.begin());
}
/* Recursion stops on bool */
template <class F>
constexpr long nested_container_size<bool>::flat_size(F)
{
return 1;
}
}
PYTHONIC_NS_END
#endif