std:: logical_and
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定义于头文件
<functional>
|
||
|
template
<
class
T
>
struct logical_and ; |
(C++14 前) | |
|
template
<
class
T
=
void
>
struct logical_and ; |
(C++14 起) | |
用于执行逻辑与运算的函数对象。实际上调用类型
T
的
operator
&&
运算符。
目录 |
特化
|
当未指定
|
成员类型
| 类型 | 定义 |
result_type
(C++17 中弃用)
(C++20 中移除)
|
bool |
first_argument_type
(C++17 中弃用)
(C++20 中移除)
|
T
|
second_argument_type
(C++17 中弃用)
(C++20 中移除)
|
T
|
|
这些成员类型通过公开继承 std:: binary_function < T, T, bool > 获得。 |
(C++11 前) |
成员函数
|
operator()
|
返回两个参数的逻辑与运算结果
(公开成员函数) |
std::logical_and:: operator()
|
bool
operator
(
)
(
const
T
&
lhs,
const
T
&
rhs
)
const
;
|
(constexpr since C++14) | |
返回 lhs 和 rhs 的逻辑与运算结果。
参数
| lhs, rhs | - | 用于计算逻辑与运算的值 |
返回值
lhs && rhs 的结果。
异常
可能抛出由实现定义的异常。
可能的实现
constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs && rhs; } |