3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-27 06:43:40 +01:00
dft_tools/doc/reference/arrays/containers/STL.rst
tayral edd1ff4529 Restructuring documentation.
A first general restructuration of the doc according to the pattern [tour|tutorial|reference].
In the reference part, objects are documented per topic.
In each topic, [definition|c++|python|hdf5] (not yet implemented)
2014-10-18 12:21:08 +01:00

26 lines
638 B
ReStructuredText

.. highlight:: c
.. _STL:
Iterators and STL
##################################################################
Standard iterators are provided that model the boost Mutable_ForwardIterator and ForwardIterator concepts
(and hence are STL compliant).
The iterator implements also two additional methods :
* it can be casted to a bool: it is true iif the iteration is not at end.
* it.indices(): returns const & to the indices at the point of the iteration.
Examples::
array<long,2> A (2,3);
for (auto it = A.begin(); it; ++it) *it =it.indices()[0] + 10 *it.indices()[1];
Some examples of usage:
.. triqs_example:: ./STL_0.cpp