std::equal_to<void>
Defined in header <functional> | | |
|---|---|---|
template<> class equal_to<void>; | | (since C++14) |
std::equal_to<>是std::equal_to并推导出参数和返回类型。
成员类型
Member type | Definition |
|---|---|
is_transparent | /* unspecified */ |
成员函数
operator() | tests if the two arguments compare equal (public member function) |
|---|
性病:平等[医]to<>::运算符%28%29
template< class T, class U> constexpr auto operator()( T&& lhs, U&& rhs ) const -> decltype(std::forward<T>(lhs) == std::forward<U>(rhs)); | | |
|---|
之间的相等比较的结果。lhs和rhs...
参数
lhs, rhs | - | values to compare |
|---|
返回值
结果std::forward<T>(lhs)==std::forward<U>(rhs)...
注记
成员类型is_transparent向调用方指示此函数对象是透明FunctionObject:它接受任意类型的参数,并使用完美的转发,这避免了在异构上下文中使用函数对象或使用rvalue参数时不必要的复制和转换。特别是模板函数,例如std::set::find和std::set::lower_bound在它们的Compare类型。
例
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

