Scarab  v2.9.1
Project 8 C++ Utility Library
Classes | Namespaces | Macros | Enumerations | Functions | Variables
operators.h File Reference
#include "pybind11.h"
Include dependency graph for operators.h:

Go to the source code of this file.

Classes

struct  self_t
 
struct  undefined_t
 Type for an unused type slot. More...
 
struct  op_impl< op_id, op_type, B, L, R >
 base template of operator implementations More...
 
struct  op_< id, ot, L, R >
 Operator implementation generator. More...
 
struct  op_impl< op_sub, op_l, B, L, R >
 
struct  op_impl< op_sub, op_r, B, L, R >
 
struct  op_impl< op_add, op_l, B, L, R >
 
struct  op_impl< op_add, op_r, B, L, R >
 
struct  op_impl< op_mul, op_l, B, L, R >
 
struct  op_impl< op_mul, op_r, B, L, R >
 
struct  op_impl< op_truediv, op_l, B, L, R >
 
struct  op_impl< op_truediv, op_r, B, L, R >
 
struct  op_impl< op_mod, op_l, B, L, R >
 
struct  op_impl< op_mod, op_r, B, L, R >
 
struct  op_impl< op_lshift, op_l, B, L, R >
 
struct  op_impl< op_lshift, op_r, B, L, R >
 
struct  op_impl< op_rshift, op_l, B, L, R >
 
struct  op_impl< op_rshift, op_r, B, L, R >
 
struct  op_impl< op_and, op_l, B, L, R >
 
struct  op_impl< op_and, op_r, B, L, R >
 
struct  op_impl< op_xor, op_l, B, L, R >
 
struct  op_impl< op_xor, op_r, B, L, R >
 
struct  op_impl< op_eq, op_l, B, L, R >
 
struct  op_impl< op_eq, op_r, B, L, R >
 
struct  op_impl< op_ne, op_l, B, L, R >
 
struct  op_impl< op_ne, op_r, B, L, R >
 
struct  op_impl< op_or, op_l, B, L, R >
 
struct  op_impl< op_or, op_r, B, L, R >
 
struct  op_impl< op_gt, op_l, B, L, R >
 
struct  op_impl< op_gt, op_r, B, L, R >
 
struct  op_impl< op_ge, op_l, B, L, R >
 
struct  op_impl< op_ge, op_r, B, L, R >
 
struct  op_impl< op_lt, op_l, B, L, R >
 
struct  op_impl< op_lt, op_r, B, L, R >
 
struct  op_impl< op_le, op_l, B, L, R >
 
struct  op_impl< op_le, op_r, B, L, R >
 
struct  op_impl< op_iadd, op_l, B, L, R >
 
struct  op_impl< op_isub, op_l, B, L, R >
 
struct  op_impl< op_imul, op_l, B, L, R >
 
struct  op_impl< op_itruediv, op_l, B, L, R >
 
struct  op_impl< op_imod, op_l, B, L, R >
 
struct  op_impl< op_ilshift, op_l, B, L, R >
 
struct  op_impl< op_irshift, op_l, B, L, R >
 
struct  op_impl< op_iand, op_l, B, L, R >
 
struct  op_impl< op_ixor, op_l, B, L, R >
 
struct  op_impl< op_ior, op_l, B, L, R >
 
struct  op_impl< op_neg, op_u, B, L, undefined_t >
 
struct  op_impl< op_pos, op_u, B, L, undefined_t >
 
struct  op_impl< op_abs, op_u, B, L, undefined_t >
 
struct  op_impl< op_hash, op_u, B, L, undefined_t >
 
struct  op_impl< op_invert, op_u, B, L, undefined_t >
 
struct  op_impl< op_bool, op_u, B, L, undefined_t >
 
struct  op_impl< op_int, op_u, B, L, undefined_t >
 
struct  op_impl< op_float, op_u, B, L, undefined_t >
 

Namespaces

 pybind11
 glibc defines I as a macro which breaks things, e.g., boost template names
 
 pybind11::detail
 

Macros

#define PYBIND11_BINARY_OPERATOR(id, rid, op, expr)
 
#define PYBIND11_INPLACE_OPERATOR(id, op, expr)
 
#define PYBIND11_UNARY_OPERATOR(id, op, expr)
 

Enumerations

enum  op_id : int {
  op_add, op_sub, op_mul, op_div,
  op_mod, op_divmod, op_pow, op_lshift,
  op_rshift, op_and, op_xor, op_or,
  op_neg, op_pos, op_abs, op_invert,
  op_int, op_long, op_float, op_str,
  op_cmp, op_gt, op_ge, op_lt,
  op_le, op_eq, op_ne, op_iadd,
  op_isub, op_imul, op_idiv, op_imod,
  op_ilshift, op_irshift, op_iand, op_ixor,
  op_ior, op_complex, op_bool, op_nonzero,
  op_repr, op_truediv, op_itruediv, op_hash
}
 Enumeration with all supported operator types. More...
 
enum  op_type : int { op_l, op_r, op_u }
 

Functions

self_t __self ()
 Don't warn about an unused variable. More...
 
op_< op_sub, op_l, self_t, self_t > operator- (const self_t &, const self_t &)
 
template<typename T >
op_< op_sub, op_l, self_t, T > operator- (const self_t &, const T &)
 
template<typename T >
op_< op_sub, op_r, T, self_t > operator- (const T &, const self_t &)
 
op_< op_add, op_l, self_t, self_t > operator+ (const self_t &, const self_t &)
 
template<typename T >
op_< op_add, op_l, self_t, T > operator+ (const self_t &, const T &)
 
template<typename T >
op_< op_add, op_r, T, self_t > operator+ (const T &, const self_t &)
 
op_< op_mul, op_l, self_t, self_t > operator* (const self_t &, const self_t &)
 
template<typename T >
op_< op_mul, op_l, self_t, T > operator* (const self_t &, const T &)
 
template<typename T >
op_< op_mul, op_r, T, self_t > operator* (const T &, const self_t &)
 
op_< op_truediv, op_l, self_t, self_t > operator/ (const self_t &, const self_t &)
 
template<typename T >
op_< op_truediv, op_l, self_t, T > operator/ (const self_t &, const T &)
 
template<typename T >
op_< op_truediv, op_r, T, self_t > operator/ (const T &, const self_t &)
 
op_< op_mod, op_l, self_t, self_t > operator% (const self_t &, const self_t &)
 
template<typename T >
op_< op_mod, op_l, self_t, T > operator% (const self_t &, const T &)
 
template<typename T >
op_< op_mod, op_r, T, self_t > operator% (const T &, const self_t &)
 
op_< op_lshift, op_l, self_t, self_t > operator<< (const self_t &, const self_t &)
 
template<typename T >
op_< op_lshift, op_l, self_t, T > operator<< (const self_t &, const T &)
 
template<typename T >
op_< op_lshift, op_r, T, self_t > operator<< (const T &, const self_t &)
 
op_< op_rshift, op_l, self_t, self_t > operator>> (const self_t &, const self_t &)
 
template<typename T >
op_< op_rshift, op_l, self_t, T > operator>> (const self_t &, const T &)
 
template<typename T >
op_< op_rshift, op_r, T, self_t > operator>> (const T &, const self_t &)
 
op_< op_and, op_l, self_t, self_t > operator & (const self_t &, const self_t &)
 
template<typename T >
op_< op_and, op_l, self_t, T > operator & (const self_t &, const T &)
 
template<typename T >
op_< op_and, op_r, T, self_t > operator & (const T &, const self_t &)
 
op_< op_xor, op_l, self_t, self_t > operator^ (const self_t &, const self_t &)
 
template<typename T >
op_< op_xor, op_l, self_t, T > operator^ (const self_t &, const T &)
 
template<typename T >
op_< op_xor, op_r, T, self_t > operator^ (const T &, const self_t &)
 
op_< op_eq, op_l, self_t, self_t > operator== (const self_t &, const self_t &)
 
template<typename T >
op_< op_eq, op_l, self_t, T > operator== (const self_t &, const T &)
 
template<typename T >
op_< op_eq, op_r, T, self_t > operator== (const T &, const self_t &)
 
op_< op_ne, op_l, self_t, self_t > operator!= (const self_t &, const self_t &)
 
template<typename T >
op_< op_ne, op_l, self_t, T > operator!= (const self_t &, const T &)
 
template<typename T >
op_< op_ne, op_r, T, self_t > operator!= (const T &, const self_t &)
 
op_< op_or, op_l, self_t, self_t > operator| (const self_t &, const self_t &)
 
template<typename T >
op_< op_or, op_l, self_t, T > operator| (const self_t &, const T &)
 
template<typename T >
op_< op_or, op_r, T, self_t > operator| (const T &, const self_t &)
 
op_< op_gt, op_l, self_t, self_t > operator> (const self_t &, const self_t &)
 
template<typename T >
op_< op_gt, op_l, self_t, T > operator> (const self_t &, const T &)
 
template<typename T >
op_< op_gt, op_r, T, self_t > operator> (const T &, const self_t &)
 
op_< op_ge, op_l, self_t, self_t > operator>= (const self_t &, const self_t &)
 
template<typename T >
op_< op_ge, op_l, self_t, T > operator>= (const self_t &, const T &)
 
template<typename T >
op_< op_ge, op_r, T, self_t > operator>= (const T &, const self_t &)
 
op_< op_lt, op_l, self_t, self_t > operator< (const self_t &, const self_t &)
 
template<typename T >
op_< op_lt, op_l, self_t, T > operator< (const self_t &, const T &)
 
template<typename T >
op_< op_lt, op_r, T, self_t > operator< (const T &, const self_t &)
 
op_< op_le, op_l, self_t, self_t > operator<= (const self_t &, const self_t &)
 
template<typename T >
op_< op_le, op_l, self_t, T > operator<= (const self_t &, const T &)
 
template<typename T >
op_< op_le, op_r, T, self_t > operator<= (const T &, const self_t &)
 
template<typename T >
op_< op_iadd, op_l, self_t, T > operator+= (const self_t &, const T &)
 
template<typename T >
op_< op_isub, op_l, self_t, T > operator-= (const self_t &, const T &)
 
template<typename T >
op_< op_imul, op_l, self_t, T > operator*= (const self_t &, const T &)
 
template<typename T >
op_< op_itruediv, op_l, self_t, T > operator/= (const self_t &, const T &)
 
template<typename T >
op_< op_imod, op_l, self_t, T > operator%= (const self_t &, const T &)
 
template<typename T >
op_< op_ilshift, op_l, self_t, T > operator<<= (const self_t &, const T &)
 
template<typename T >
op_< op_irshift, op_l, self_t, T > operator>>= (const self_t &, const T &)
 
template<typename T >
op_< op_iand, op_l, self_t, T > operator &= (const self_t &, const T &)
 
template<typename T >
op_< op_ixor, op_l, self_t, T > operator^= (const self_t &, const T &)
 
template<typename T >
op_< op_ior, op_l, self_t, T > operator|= (const self_t &, const T &)
 
op_< op_neg, op_u, self_t, undefined_t > operator- (const self_t &)
 
op_< op_pos, op_u, self_t, undefined_t > operator+ (const self_t &)
 
op_< op_abs, op_u, self_t, undefined_t > abs (const self_t &)
 
op_< op_hash, op_u, self_t, undefined_t > hash (const self_t &)
 
op_< op_invert, op_u, self_t, undefined_t > operator~ (const self_t &)
 
op_< op_bool, op_u, self_t, undefined_t > operator! (const self_t &)
 
op_< op_int, op_u, self_t, undefined_t > int_ (const self_t &)
 
op_< op_float, op_u, self_t, undefined_t > float_ (const self_t &)
 

Variables

static const self_t self = self_t()
 

Macro Definition Documentation

◆ PYBIND11_BINARY_OPERATOR

#define PYBIND11_BINARY_OPERATOR (   id,
  rid,
  op,
  expr 
)
Value:
template <typename B, typename L, typename R> struct op_impl<op_##id, op_l, B, L, R> { \
static char const* name() { return "__" #id "__"; } \
static auto execute(const L &l, const R &r) -> decltype(expr) { return (expr); } \
static B execute_cast(const L &l, const R &r) { return B(expr); } \
}; \
template <typename B, typename L, typename R> struct op_impl<op_##id, op_r, B, L, R> { \
static char const* name() { return "__" #rid "__"; } \
static auto execute(const R &r, const L &l) -> decltype(expr) { return (expr); } \
static B execute_cast(const R &r, const L &l) { return B(expr); } \
}; \
inline op_<op_##id, op_l, self_t, self_t> op(const self_t &, const self_t &) { \
return op_<op_##id, op_l, self_t, self_t>(); \
} \
template <typename T> op_<op_##id, op_l, self_t, T> op(const self_t &, const T &) { \
return op_<op_##id, op_l, self_t, T>(); \
} \
template <typename T> op_<op_##id, op_r, T, self_t> op(const T &, const self_t &) { \
return op_<op_##id, op_r, T, self_t>(); \
}

Definition at line 80 of file operators.h.

◆ PYBIND11_INPLACE_OPERATOR

#define PYBIND11_INPLACE_OPERATOR (   id,
  op,
  expr 
)
Value:
template <typename B, typename L, typename R> struct op_impl<op_##id, op_l, B, L, R> { \
static char const* name() { return "__" #id "__"; } \
static auto execute(L &l, const R &r) -> decltype(expr) { return expr; } \
static B execute_cast(L &l, const R &r) { return B(expr); } \
}; \
template <typename T> op_<op_##id, op_l, self_t, T> op(const self_t &, const T &) { \
return op_<op_##id, op_l, self_t, T>(); \
}

Definition at line 101 of file operators.h.

◆ PYBIND11_UNARY_OPERATOR

#define PYBIND11_UNARY_OPERATOR (   id,
  op,
  expr 
)
Value:
template <typename B, typename L> struct op_impl<op_##id, op_u, B, L, undefined_t> { \
static char const* name() { return "__" #id "__"; } \
static auto execute(const L &l) -> decltype(expr) { return expr; } \
static B execute_cast(const L &l) { return B(expr); } \
}; \
inline op_<op_##id, op_u, self_t, undefined_t> op(const self_t &) { \
return op_<op_##id, op_u, self_t, undefined_t>(); \
}

Definition at line 111 of file operators.h.