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

加法函数子。 More...

#include <gextra.h>

Public Member Functions

template<class T, class U>
auto operator() (T a, U b) const -> decltype(a+b)
 对两个值执行加法。

Detailed Description

加法函数子。

等价于 operator+,支持任意类型(只要定义了 operator+)。 用于 reduce 等需要二元操作的场景。

Member Function Documentation

◆ operator()()

template<class T, class U>
auto console::ops::plus_t::operator() ( T a,
U b ) const -> decltype(a+b)
inline

对两个值执行加法。

Template Parameters
T左操作数类型。
U右操作数类型。
Parameters
a左操作数。
b右操作数。
Returns
decltype(a + b) 两数之和。

The documentation for this struct was generated from the following file: