Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template counting_iterator

Boost , Chapter 1. Boost.Compute , Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template counting_iterator

boost::compute::counting_iterator — The counting_iterator class implements a counting iterator.

Synopsis

// In header: <boost/compute/iterator/counting_iterator.hpp>
template<typename T> 
class counting_iterator {
public:
  // types
  typedef unspecified                 super_type;     
  typedef super_type::reference       reference;      
  typedef super_type::difference_type difference_type;
  // construct/copy/destruct
  counting_iterator(const T &);
  counting_iterator(const counting_iterator< T > &);
  counting_iterator< T > & operator=(const counting_iterator< T > &);
  ~counting_iterator();
  // public member functions
  size_t get_index() const;
  template<typename Expr> unspecified operator[](const Expr &) const;
  // private member functions
  reference dereference() const;
  bool equal(const counting_iterator< T > &) const;
  void increment();
  void decrement();
  void advance(difference_type);
  difference_type distance_to(const counting_iterator< T > &) const;
};

Description

Итератор подсчета возвращает внутреннее значение (инициализируется с<init>), которое увеличивается каждый раз, когда итератор увеличивается.

Например, это может быть использовано для реализации алгоритма iota() в терминах алгоритма copy() путем копирования из ряда итераторов подсчета:

См. также:

make_counting_iterator()

counting_iterator public construct/copy/destruct

  1. <
    counting_iterator(constT&init);
    >
  2. <
    counting_iterator(constcounting_iterator<T>&other);
    >
  3. <
    counting_iterator<T>&operator=(constcounting_iterator<T>&other);
    >
  4. <
    ~counting_iterator();
    >

counting_iterator public member functions

  1. <
    size_tget_index()const;
    >
  2. <
    template<typenameExpr>unspecifiedoperator[](constExpr&expr)const;
    >

counting_iterator private member functions

  1. <
    referencedereference()const;
    >
  2. <
    boolequal(constcounting_iterator<T>&other)const;
    >
  3. <
    voidincrement();
    >
  4. <
    voiddecrement();
    >
  5. <
    voidadvance(difference_typen);
    >
  6. <
    difference_typedistance_to(constcounting_iterator<T>&other)const;
    >

PrevUpHomeNext

Статья Class template counting_iterator раздела Chapter 1. Boost.Compute Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 23:49:28/0.0065310001373291/0