首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::divides<void>

Defined in header <functional>

template<> class divides<void>;

(since C++14)

std::divides<>std::divides并推导出参数和返回类型。

成员类型

Member type

Definition

is_transparent

/* unspecified */

成员函数

operator()

returns the quotient of two arguments (public member function)

std::divids<>::Operator%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%28或其他operator/重载到执行%29。

参数

lhs, rhs

-

values to divide

返回值

结果lhs / rhs...

注记

成员类型is_transparent向调用方指示此函数对象是透明FunctionObject:它接受任意类型的参数,并使用完美的转发,这避免了在异构上下文中使用函数对象或使用rvalue参数时不必要的复制和转换。特别是模板函数,例如std::set::findstd::set::lower_bound在它们的Compare类型。

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券