Boost C++ 库

...世界上最受推崇和设计最精湛的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码标准

PrevUpHomeNext

类模板 last_value

boost::signals2::last_value — 评估一个 InputIterator 序列,并返回序列中的最后一个值。

概要

// In header: <boost/signals2/last_value.hpp>

template<typename T> 
class last_value {
public:
  // types
  typedef T result_type;

  // invocation
  template<typename InputIterator> 
    result_type operator()(InputIterator, InputIterator) const;
};

描述

last_value 类是原始 Signals 库中 signals 的默认 Combiner 模板参数类型。Signals2 使用 optional_last_value 作为默认值,它不会抛出异常。

last_value 调用

  1. template<typename InputIterator> 
      result_type operator()(InputIterator first, InputIterator last) const;

    效果

    尝试解引用序列 [first, last) 中的每个迭代器。

    返回

    最后一次成功迭代器解引用的结果。

    抛出

    如果没有迭代器成功解引用,则抛出 no_slots_error 异常,除非 last_value 的模板类型是 void


PrevUpHomeNext