MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
绑定函数

函数绑定和部分应用的工具 更多...

class  binder< Sign >
 通用函数绑定器 更多...
class  binder< Func(BoundArgs...)>
 通用函数绑定器的部分特化 更多...
class  bindrer< Res, Sign >
 指定返回类型的函数绑定器 更多...
class  bindrer< Res, Func(BoundArgs...)>
 指定返回类型的函数绑定器部分特化 更多...
struct  bind_helper< IntLike, Func, BoundArgs >
 bind辅助类型推导器 更多...
struct  bindr_helper< Res, Func, BoundArgs >
 指定返回类型的bind辅助类型推导器 更多...
class  binder_front< Func, BoundArgs >
 前向参数绑定器 更多...

类型定义

template<bool IntLike, typename Func, typename... BoundArgs>
using bind_helper_t = typename bind_helper<IntLike, Func, BoundArgs...>::type
 bind_helper的便捷别名
template<typename Res, typename Func, typename... BoundArgs>
using bindr_helper_t = typename bindr_helper<Res, Func, BoundArgs...>::type
 bindr_helper的便捷别名
template<typename Func, typename... Args>
using binder_front_type = binder_front<decay_t<Func>, decay_t<Args>...>
 binder_front类型的便捷别名

函数

template<typename Func, typename... BoundArgs>
 MSTL_DEPRECATE_FOR ("use lambda or bind_front instead of bind") MSTL_NODISCARD const expr bind_helper_t< is_integral_like_v< Func >
 bind函数
template<typename Res, typename Func, typename... BoundArgs>
 MSTL_DEPRECATE_FOR ("use lambda or bind_front instead of bind") MSTL_NODISCARD const expr bindr_helper_t< Res
 指定返回类型的bind函数
template<typename Func, typename... Args>
MSTL_NODISCARD constexpr binder_front_type< Func, Args... > bind_front (Func &&func, Args &&... args) noexcept(is_nothrow_constructible< binder_front_type< Func, Args... >, int, Func, Args... >::value)
 bind_front函数

详细描述

函数绑定和部分应用的工具

类型定义说明

◆ binder_front_type

template<typename Func, typename... Args>
using binder_front_type = binder_front<decay_t<Func>, decay_t<Args>...>

binder_front类型的便捷别名

模板参数
Func函数类型
Args绑定参数类型

在文件 bind.hpp956 行定义.

函数说明

◆ bind_front()

template<typename Func, typename... Args>
MSTL_NODISCARD constexpr binder_front_type< Func, Args... > bind_front ( Func && func,
Args &&... args )
constexprnoexcept

bind_front函数

模板参数
Func可调用对象类型
Args绑定的参数类型
参数
func要绑定的函数对象
args绑定的参数
返回
前向绑定后的函数对象

创建前向参数绑定器,将参数绑定到函数的前几个位置。

在文件 bind.hpp970 行定义.

引用了 _MSTL , 以及 forward().

◆ MSTL_DEPRECATE_FOR() [1/2]

template<typename Func, typename... BoundArgs>
MSTL_DEPRECATE_FOR ( "use lambda or bind_front instead of bind" ) const

bind函数

模板参数
Func可调用对象类型
BoundArgs绑定的参数类型
参数
func要绑定的函数对象
args绑定的参数
返回
绑定后的函数对象

创建函数绑定器,支持占位符参数重排。返回的绑定器可以存储并稍后调用。

弃用
此函数已被标记为弃用,建议使用lambda表达式或bind_front替代。

引用了 _MSTL , 以及 forward().

◆ MSTL_DEPRECATE_FOR() [2/2]

template<typename Res, typename Func, typename... BoundArgs>
MSTL_DEPRECATE_FOR ( "use lambda or bind_front instead of bind" ) const

指定返回类型的bind函数

模板参数
Res指定的返回类型
Func可调用对象类型
BoundArgs绑定的参数类型
参数
func要绑定的函数对象
args绑定的参数
返回
绑定后的函数对象

创建指定返回类型的函数绑定器,调用时会强制将结果转换为Res类型。

引用了 _MSTL , 以及 forward().