跳到主要内容

11. depr (已弃用)

包含被弃用的特性,是标准中保留但不应在新代码中使用的组件。


template <class Arg, class Result> struct unary_function

一元函数基类。

  • 输入: Arg, Result
  • 输出: 基类
  • 注意: C++11 废弃

template <class Arg1, class Arg2, class Result> struct binary_function

二元函数基类。

  • 输入: Arg1, Arg2, Result
  • 输出: 基类
  • 注意: C++11 废弃

template <class Predicate> unary_negate<Predicate> not1(const Predicate& pred)

一元否定。

  • 输入: pred
  • 输出: unary_negate
  • 注意: 已废弃

template <class Predicate> binary_negate<Predicate> not2(const Predicate& pred)

二元否定。

  • 输入: pred
  • 输出: binary_negate
  • 注意: 已废弃

template <class Operation, class T> binder1st<Operation> bind1st(const Operation& op, const T& x)

绑定第一个参数。

  • 输入: op, x
  • 输出: binder1st
  • 注意: 已废弃

template <class Operation, class T> binder2nd<Operation> bind2nd(const Operation& op, const T& x)

绑定第二个参数。

  • 输入: op, x
  • 输出: binder2nd
  • 注意: 已废弃

template <class S, class T> mem_fun_t<S, T> mem_fun(S (T::*f)())

成员函数包装。

  • 输入: f
  • 输出: mem_fun_t
  • 注意: 已废弃

template <class S, class T> mem_fun_ref_t<S, T> mem_fun_ref(S (T::*f)())

引用成员函数包装。

  • 输入: f
  • 输出: mem_fun_ref_t
  • 注意: 已废弃

template <class Arg, class Result> pointer_to_unary_function<Arg, Result> ptr_fun(Result (*f)(Arg))

函数指针包装。

  • 输入: f
  • 输出: pointer_to_unary_function
  • 注意: 已废弃

template <class X> class auto_ptr

旧智能指针。

  • 输入: X
  • 输出: auto_ptr 对象
  • 注意: C++11 废弃

template <class OutputIterator, class T> class raw_storage_iterator

原始存储迭代器。

  • 输入: OutputIterator, T
  • 输出: 迭代器对象
  • 注意: C++17 废弃、C++20 自标准移除;但在 C++14 下存在且可用。

void random_shuffle(RandomAccessIterator first, RandomAccessIterator last)

随机打乱。

  • 输入: first, last
  • 输出: void
  • 注意: C++14 废弃、C++17 自标准移除;但本库未按 C++17 移除 → C++14 下仍可用,属保留性偏差(见 13.3)。新代码应改用 shuffle。

template <class T> struct is_literal_type

字面量类型判断。

  • 输入: T
  • 输出: bool
  • 注意: C++17 废弃、C++20 自标准移除;但在 C++14 下存在且可用。

template <class T> struct result_of

调用结果类型。

  • 输入: T
  • 输出: 返回类型
  • 注意: C++17 废弃、C++20 自标准移除;但在 C++14 下存在且可用。