403Webshell
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/builtins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pythran/pythonic/builtins/minmax.hpp
#ifndef PYTHONIC_BUILTIN_MINMAX_HPP
#define PYTHONIC_BUILTIN_MINMAX_HPP

#include "pythonic/include/builtins/minmax.hpp"

#include <utility>
#include <algorithm>

PYTHONIC_NS_BEGIN

namespace builtins
{

  namespace details
  {
    template <typename Op, class T>
    typename std::decay<T>::type::value_type minmax(Op const &op, T &&t)
    {
      return *std::max_element(t.begin(), t.end(), op);
    }

    template <typename Op, class T, class F>
    typename std::decay<T>::type::value_type minmax(Op const &op, T &&t,
                                                    types::kwonly, F key)
    {
      using value_type = decltype(*t.begin());
      return *std::max_element(
                 t.begin(), t.end(),
                 [op, key](value_type const &self, value_type const &other) {
                   return op(key(self), key(other));
                 });
    }

    template <class Op, class T0, class T1, class... Types>
    typename std::enable_if<!std::is_same<T1, types::kwonly>::value,
                            typename __combined<T0, T1, Types...>::type>::type
    minmax(Op const &op, T0 const &t0, T1 const &t1, Types const &... ts)
    {
      using value_type = typename __combined<T0, T1, Types...>::type;
      std::initializer_list<value_type> values = {
          static_cast<value_type>(t0), static_cast<value_type>(t1),
          static_cast<value_type>(ts)...};
      return minmax(op, values);
    }
  }
}
PYTHONIC_NS_END

#endif

Youez - 2016 - github.com/yon3zu
LinuXploit