| 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/include/utils/ |
Upload File : |
#ifndef PYTHONIC_INCLUDE_UTILS_FUNCTOR_HPP
#define PYTHONIC_INCLUDE_UTILS_FUNCTOR_HPP
#include <utility>
// create a function named `name' using function `f'
#define DEFINE_FUNCTOR_2(name, f) \
namespace functor \
{ \
struct name { \
using callable = void; \
template <typename... Types> \
auto operator()(Types && ... types) const \
-> decltype(f(std::forward<Types>(types)...)) \
{ \
return f(std::forward<Types>(types)...); \
} \
\
friend std::ostream &operator<<(std::ostream &os, name) \
{ \
return os << #name; \
} \
}; \
}
// create a functor named `f' using function `ns::f'
#define DEFINE_FUNCTOR(ns, f) DEFINE_FUNCTOR_2(f, ns::f)
#define USING_FUNCTOR(f, alias) \
namespace functor \
{ \
using f = alias; \
}
#endif