μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Enumerations | Functions | Variables
operators.h File Reference
#include "pybind11.h"
Include dependency graph for operators.h:
This graph shows which files directly or indirectly include this file:

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...
 

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 ,
  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 , op_l ,
  op_r , op_u
}
 

Functions

self_t __self ()
 Don't warn about an unused variable. More...
 

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 &) { \
} \
template <typename T> \
op_<op_##id, op_l, self_t, T> op(const self_t &, const T &) { \
} \
template <typename T> \
op_<op_##id, op_r, T, self_t> op(const T &, const self_t &) { \
}
@ op_l
Definition: operators.h:66
@ op_r
Definition: operators.h:67
Annotation for function names.
Definition: attr.h:47
Operator implementation generator.
Definition: operators.h:86
base template of operator implementations
Definition: operators.h:82

Definition at line 106 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 &) { \
}

Definition at line 131 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); } \
}; \
}
@ op_u
Definition: operators.h:68
Type for an unused type slot.
Definition: operators.h:75

Definition at line 143 of file operators.h.

Enumeration Type Documentation

◆ op_id

enum op_id : int

Enumeration with all supported operator types.

Enumerator
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 
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 

Definition at line 18 of file operators.h.

◆ op_type

enum op_type : int
Enumerator
op_l 
op_r 
op_u 
op_l 
op_r 
op_u 

Definition at line 65 of file operators.h.

Function Documentation

◆ __self()

self_t __self ( )
inline

Don't warn about an unused variable.

Definition at line 78 of file operators.h.

References self.

Variable Documentation

◆ self

const self_t self = self_t()
static

Definition at line 72 of file operators.h.

Referenced by __self().