mirror of
https://github.com/triqs/dft_tools
synced 2024-12-27 06:43:40 +01:00
edd1ff4529
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)
26 lines
638 B
ReStructuredText
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
|