Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
console::ops Namespace Reference

Classes

struct  abs_t
 绝对值变换器。 More...
struct  acos_t
 反余弦变换器。 More...
struct  Add
 加固定值变换器。 More...
struct  always_false_t
 恒假谓词。 More...
struct  always_true_t
 恒真谓词。 More...
struct  And
 逻辑与组合器。 More...
struct  as
 转型变化器。 More...
struct  asin_t
 反正弦变换器。 More...
struct  atan_t
 反正切变换器。 More...
struct  average_t
 范围平均值变换器。 More...
struct  Between
 区间谓词(闭区间)。 More...
struct  BetweenExclusive
 区间谓词(开区间)。 More...
struct  Call
 函数调用变化器。 More...
struct  ceil_t
 向上取整变换器。 More...
struct  Clamp
 限幅变换器。 More...
struct  Compose
 函数组合器,将两个函数组合为一个函数。 More...
struct  cos_t
 余弦变换器。 More...
struct  cube_t
 立方变换器。 More...
struct  dec_t
 自减变换器。 More...
struct  Div
 除固定值变换器。 More...
struct  divides_t
 除法函数子。 More...
struct  DivisibleBy
 整除谓词。 More...
struct  empty_t
 容器判空谓词。 More...
struct  Eq
 等于谓词。 More...
struct  even_t
 偶数谓词。 More...
struct  exp_t
 自然指数变换器。 More...
struct  first_t
 取 pair 的 first 变换器。 More...
struct  floor_t
 向下取整变换器。 More...
struct  Ge
 大于等于谓词。 More...
struct  Gt
 大于谓词。 More...
struct  identity_t
 恒等变换器。 More...
struct  inc_t
 自增变换器。 More...
struct  is_null_t
struct  Le
 小于等于谓词。 More...
struct  log10_t
 常用对数变换器(以10为底)。 More...
struct  Lt
 小于谓词。 More...
struct  max_element_t
 容器最大值变换器。 More...
struct  Member
 取成员变量变换器。 More...
struct  Method
 成员函数调用变换器。 More...
struct  min_element_t
 容器最小值变换器。 More...
struct  minus_t
 减法函数子。 More...
struct  Mod
 取模固定值变换器。 More...
struct  modulus_t
 取模函数子。 More...
struct  Mul
 乘固定值变换器。 More...
struct  multiplies_t
 乘法函数子。 More...
struct  Ne
 不等于谓词。 More...
struct  negate_t
 取负变换器。 More...
struct  negative_t
 负数谓词。 More...
struct  Not
 逻辑非组合器。 More...
struct  not_null_t
struct  nth_t
struct  odd_t
 奇数谓词。 More...
struct  Or
 逻辑或组合器。 More...
struct  palindrome_t
 回文数谓词。 More...
struct  plus_t
 加法函数子。 More...
struct  positive_t
 正数谓词。 More...
struct  Pow
 幂运算变换器。 More...
struct  power_of_two_t
 2的幂次谓词。 More...
struct  prime_t
 素数谓词。 More...
struct  reciprocal_t
 倒数变换器。 More...
struct  reverse_string_t
 字符串反转变换器。 More...
struct  round_t
 四舍五入变换器。 More...
struct  second_t
 取 pair 的 second 变换器。 More...
struct  sign_t
 符号变换器。 More...
struct  sin_t
 正弦变换器。 More...
struct  size_t_
 容器大小变换器。 More...
struct  sqrt_t
 平方根变换器。 More...
struct  square_t
 平方变换器。 More...
struct  strlen_t
 字符串长度变换器。 More...
struct  Sub
 减固定值变换器。 More...
struct  sum_t
 范围求和变换器。 More...
struct  tan_t
 正切变换器。 More...
struct  timestamp_t
 时间戳生成器。 More...
struct  to_lower_t
 字符串转小写变换器。 More...
struct  to_string_t
 转为字符串变换器。 More...
struct  to_upper_t
 字符串转大写变换器。 More...
struct  trim_t
 字符串去空格变换器。 More...
struct  unique
 相邻去重过滤器。 More...
struct  zero_t
 零谓词。 More...

Functions

template<class T>
Add< T > add (T v)
 创建加固定值变换器。
template<class T>
Sub< T > sub (T v)
 创建减固定值变换器。
template<class T>
Mul< T > mul (T v)
 创建乘固定值变换器。
template<class T>
Div< T > div (T v)
 创建除固定值变换器。
template<class T>
Mod< T > mod (T v)
 创建取模固定值变换器。
template<class T>
Gt< T > gt (T t)
 创建大于谓词。
template<class T>
Ge< T > ge (T t)
 创建大于等于谓词。
template<class T>
Lt< T > lt (T t)
 创建小于谓词。
template<class T>
Le< T > le (T t)
 创建小于等于谓词。
template<class T>
Eq< T > eq (T v)
 创建等于谓词。
template<class T>
Ne< T > ne (T v)
 创建不等于谓词。
template<class P, typename Q>
And< P, Q > and_ (P p, Q q)
 创建逻辑与组合谓词。
template<class P, typename Q>
Or< P, Q > or_ (P p, Q q)
 创建逻辑或组合谓词。
template<class P>
Not< P > not_ (P p)
 创建逻辑非组合谓词。
template<class Class, typename Mem>
Member< Class, Mem > member (Mem Class::*p)
 创建成员变量访问器。
template<class P, class Q>
And< P, Q > operator&& (P p, Q q)
 逻辑与运算符,等价于 and_(p, q)。
template<class P, class Q>
Or< P, Q > operator|| (P p, Q q)
 逻辑或运算符,等价于 or_(p, q)。
template<class P>
Not< P > operator! (P p)
 逻辑非运算符,等价于 not_(p)。
template<class F, class G>
Compose< F, G > compose (F f, G g)
 将两个函数组合为一个函数。
template<class F, class... Rest>
auto compose (F f, Rest... rest) -> Compose< F, decltype(compose(rest...))>
 将多个函数组合为一个函数。
template<class F, class G>
Compose< F, G > operator>> (F f, G g)
 函数组合运算符,将两个函数组合为一个函数。
template<class T>
Pow< T > pow (T exp)
 创建幂运算变换器。
template<class T>
Between< T > between (T low, T high)
 创建闭区间谓词。
template<class T>
BetweenExclusive< T > between_exclusive (T low, T high)
 创建开区间谓词。
template<class T>
DivisibleBy< T > divisible_by (T n)
 创建整除谓词。
template<class T>
Clamp< T > clamp (T low, T high)
 创建限幅变换器。
template<size_t N>
nth_t< N > nth ()
 获取 tuple/pair/array 的第 N 个元素的函数。
template<class Class, class Ret, class... Args>
Method< Class, Ret, Args... > method (Ret(Class::*ptr)(Args...), const Args &...args)
 创建成员函数调用器。
template<class... Args>
Call< Args... > call (const Args &...args)
 创建函数调用器。

Variables

static constexpr inc_t inc
static constexpr dec_t dec
static constexpr negate_t negate
static constexpr square_t square
static constexpr cube_t cube
static constexpr sqrt_t sqrt
static constexpr reciprocal_t reciprocal
static constexpr abs_t abs
static constexpr to_string_t to_string
static constexpr even_t even
static constexpr odd_t odd
static constexpr positive_t positive
static constexpr negative_t negative
static constexpr zero_t zero
static constexpr prime_t prime
static constexpr first_t first
static constexpr second_t second
static constexpr identity_t identity
static constexpr exp_t exp
static constexpr log10_t log10
static constexpr sin_t sin
static constexpr cos_t cos
static constexpr tan_t tan
static constexpr asin_t asin
static constexpr acos_t acos
static constexpr atan_t atan
static constexpr sign_t sign
static constexpr round_t round
static constexpr ceil_t ceil
static constexpr floor_t floor
static constexpr strlen_t strlen
static constexpr to_upper_t to_upper
static constexpr to_lower_t to_lower
static constexpr trim_t trim
static constexpr reverse_string_t reverse_string
static constexpr size_t_ size
static constexpr empty_t empty
static constexpr max_element_t max_element
static constexpr min_element_t min_element
static constexpr sum_t sum
static constexpr average_t average
static constexpr power_of_two_t power_of_two
static constexpr palindrome_t palindrome
static constexpr always_true_t always_true
static constexpr always_false_t always_false
static constexpr timestamp_t timestamp
static constexpr plus_t plus
static constexpr minus_t minus
static constexpr multiplies_t multiplies
static constexpr divides_t divides
static constexpr modulus_t modulus
static constexpr is_null_t is_null
static constexpr not_null_t not_null

Function Documentation

◆ add()

template<class T>
Add< T > console::ops::add ( T v)

创建加固定值变换器。

Template Parameters
T值类型(自动推导)。
Parameters
v要加的值。

◆ and_()

template<class P, typename Q>
And< P, Q > console::ops::and_ ( P p,
Q q )

创建逻辑与组合谓词。

◆ between()

template<class T>
Between< T > console::ops::between ( T low,
T high )

创建闭区间谓词。

Template Parameters
T元素类型(自动推导)。
Parameters
low区间下界。
high区间上界。
Returns
Between<T> 区间谓词。

◆ between_exclusive()

template<class T>
BetweenExclusive< T > console::ops::between_exclusive ( T low,
T high )

创建开区间谓词。

Template Parameters
T元素类型(自动推导)。
Parameters
low区间下界。
high区间上界。
Returns
BetweenExclusive<T> 区间谓词。

◆ call()

template<class... Args>
Call< Args... > console::ops::call ( const Args &... args)

创建函数调用器。

◆ clamp()

template<class T>
Clamp< T > console::ops::clamp ( T low,
T high )

创建限幅变换器。

Template Parameters
T元素类型(自动推导)。
Parameters
low下界。
high上界。
Returns
Clamp<T> 限幅变换器。

◆ compose() [1/2]

template<class F, class G>
Compose< F, G > console::ops::compose ( F f,
G g )

将两个函数组合为一个函数。

Template Parameters
F第一个函数类型。
G第二个函数类型。
Parameters
f第一个函数。
g第二个函数。
Returns
Compose<F, G> 组合后的函数。

◆ compose() [2/2]

template<class F, class... Rest>
auto console::ops::compose ( F f,
Rest... rest ) -> Compose< F, decltype(compose(rest...))>

将多个函数组合为一个函数。

Template Parameters
F第一个函数类型。
...Rest其余函数类型。
Parameters
f第一个函数。
rest其余函数。
Returns
Compose<F, Compose<Rest...>> 组合后的函数。

◆ div()

template<class T>
Div< T > console::ops::div ( T v)

创建除固定值变换器。

Parameters
v要除的值。

◆ divisible_by()

template<class T>
DivisibleBy< T > console::ops::divisible_by ( T n)

创建整除谓词。

Template Parameters
T元素类型(自动推导)。
Parameters
n除数。
Returns
DivisibleBy<T> 整除谓词。

◆ eq()

template<class T>
Eq< T > console::ops::eq ( T v)

创建等于谓词。

◆ ge()

template<class T>
Ge< T > console::ops::ge ( T t)

创建大于等于谓词。

◆ gt()

template<class T>
Gt< T > console::ops::gt ( T t)

创建大于谓词。

◆ le()

template<class T>
Le< T > console::ops::le ( T t)

创建小于等于谓词。

◆ lt()

template<class T>
Lt< T > console::ops::lt ( T t)

创建小于谓词。

◆ member()

template<class Class, typename Mem>
Member< Class, Mem > console::ops::member ( Mem Class::* p)

创建成员变量访问器。

◆ method()

template<class Class, class Ret, class... Args>
Method< Class, Ret, Args... > console::ops::method ( Ret(Class::* ptr )(Args...),
const Args &... args )

创建成员函数调用器。

◆ mod()

template<class T>
Mod< T > console::ops::mod ( T v)

创建取模固定值变换器。

Parameters
v要取模的值。

◆ mul()

template<class T>
Mul< T > console::ops::mul ( T v)

创建乘固定值变换器。

Parameters
v要乘的值。

◆ ne()

template<class T>
Ne< T > console::ops::ne ( T v)

创建不等于谓词。

◆ not_()

template<class P>
Not< P > console::ops::not_ ( P p)

创建逻辑非组合谓词。

◆ nth()

template<size_t N>
nth_t< N > console::ops::nth ( )

获取 tuple/pair/array 的第 N 个元素的函数。

Parameters
N元素索引。
Returns
nth_t<N> 对象。

◆ operator!()

template<class P>
Not< P > console::ops::operator! ( P p)

逻辑非运算符,等价于 not_(p)。

Note
小范围内的重载,依赖 ADL,作用域可控。

◆ operator&&()

template<class P, class Q>
And< P, Q > console::ops::operator&& ( P p,
Q q )

逻辑与运算符,等价于 and_(p, q)。

Note
小范围内的重载,依赖 ADL,作用域可控。

◆ operator>>()

template<class F, class G>
Compose< F, G > console::ops::operator>> ( F f,
G g )

函数组合运算符,将两个函数组合为一个函数。

Template Parameters
F第一个函数类型。
G第二个函数类型。
Parameters
f第一个函数。
g第二个函数。
Returns
Compose<F, G> 组合后的函数。

◆ operator||()

template<class P, class Q>
Or< P, Q > console::ops::operator|| ( P p,
Q q )

逻辑或运算符,等价于 or_(p, q)。

Note
小范围内的重载,依赖 ADL,作用域可控。

◆ or_()

template<class P, typename Q>
Or< P, Q > console::ops::or_ ( P p,
Q q )

创建逻辑或组合谓词。

◆ pow()

template<class T>
Pow< T > console::ops::pow ( T exp)

创建幂运算变换器。

Template Parameters
T指数类型(自动推导)。
Parameters
exp指数值。
Returns
Pow<T> 幂运算变换器。

◆ sub()

template<class T>
Sub< T > console::ops::sub ( T v)

创建减固定值变换器。

Parameters
v要减的值。

Variable Documentation

◆ abs

abs_t console::ops::abs
staticconstexpr

◆ acos

acos_t console::ops::acos
staticconstexpr

◆ always_false

always_false_t console::ops::always_false
staticconstexpr

◆ always_true

always_true_t console::ops::always_true
staticconstexpr

◆ asin

asin_t console::ops::asin
staticconstexpr

◆ atan

atan_t console::ops::atan
staticconstexpr

◆ average

average_t console::ops::average
staticconstexpr

◆ ceil

ceil_t console::ops::ceil
staticconstexpr

◆ cos

cos_t console::ops::cos
staticconstexpr

◆ cube

cube_t console::ops::cube
staticconstexpr

◆ dec

dec_t console::ops::dec
staticconstexpr

◆ divides

divides_t console::ops::divides
staticconstexpr

◆ empty

empty_t console::ops::empty
staticconstexpr

◆ even

even_t console::ops::even
staticconstexpr

◆ exp

exp_t console::ops::exp
staticconstexpr

◆ first

first_t console::ops::first
staticconstexpr

◆ floor

floor_t console::ops::floor
staticconstexpr

◆ identity

identity_t console::ops::identity
staticconstexpr

◆ inc

inc_t console::ops::inc
staticconstexpr

◆ is_null

is_null_t console::ops::is_null
staticconstexpr

◆ log10

log10_t console::ops::log10
staticconstexpr

◆ max_element

max_element_t console::ops::max_element
staticconstexpr

◆ min_element

min_element_t console::ops::min_element
staticconstexpr

◆ minus

minus_t console::ops::minus
staticconstexpr

◆ modulus

modulus_t console::ops::modulus
staticconstexpr

◆ multiplies

multiplies_t console::ops::multiplies
staticconstexpr

◆ negate

negate_t console::ops::negate
staticconstexpr

◆ negative

negative_t console::ops::negative
staticconstexpr

◆ not_null

not_null_t console::ops::not_null
staticconstexpr

◆ odd

odd_t console::ops::odd
staticconstexpr

◆ palindrome

palindrome_t console::ops::palindrome
staticconstexpr

◆ plus

plus_t console::ops::plus
staticconstexpr

◆ positive

positive_t console::ops::positive
staticconstexpr

◆ power_of_two

power_of_two_t console::ops::power_of_two
staticconstexpr

◆ prime

prime_t console::ops::prime
staticconstexpr

◆ reciprocal

reciprocal_t console::ops::reciprocal
staticconstexpr

◆ reverse_string

reverse_string_t console::ops::reverse_string
staticconstexpr

◆ round

round_t console::ops::round
staticconstexpr

◆ second

second_t console::ops::second
staticconstexpr

◆ sign

sign_t console::ops::sign
staticconstexpr

◆ sin

sin_t console::ops::sin
staticconstexpr

◆ size

size_t_ console::ops::size
staticconstexpr

◆ sqrt

sqrt_t console::ops::sqrt
staticconstexpr

◆ square

square_t console::ops::square
staticconstexpr

◆ strlen

strlen_t console::ops::strlen
staticconstexpr

◆ sum

sum_t console::ops::sum
staticconstexpr

◆ tan

tan_t console::ops::tan
staticconstexpr

◆ timestamp

timestamp_t console::ops::timestamp
staticconstexpr

◆ to_lower

to_lower_t console::ops::to_lower
staticconstexpr

◆ to_string

to_string_t console::ops::to_string
staticconstexpr

◆ to_upper

to_upper_t console::ops::to_upper
staticconstexpr

◆ trim

trim_t console::ops::trim
staticconstexpr

◆ zero

zero_t console::ops::zero
staticconstexpr