Loading...
Searching...
No Matches
VdfReadIteratorRange Class Reference

This class allows for construction of iterable ranges of input values. More...

#include <readIteratorRange.h>

Detailed Description

This class allows for construction of iterable ranges of input values.

The underlying iterator used is VdfReadIterator. The VdfReadIteratorRange::begin() and VdfReadIteatorRange::end() methods return an instance of VdfReadIterator<T> denoting the iterable range. The class satisfies the STL API requirements that make it suitable for use in range- based for loops.

For example:

VdfReadIteratorRange<double> range(context, _tokens->in);
for (const double x : range) {
...
}
This class allows for construction of iterable ranges of input values.

This class can also be used to copy ranges of input values into STL containers. It can be used in range constructors, for example.

VdfReadIteratorRange<double> range(context, _tokens->in);
std::vector<double> values(range.begin(), range.end());
Warning
Note that std::distance has linear complexity on this range.

Determining the number of input values in a range is not trivial, and might be costly. Invoking std::distance on VdfReadIterator is slightly more expensive than calling VdfReadIteratorRange::ComputeSize() (i.e. VdfReadIterator::ComputeSize().)


The documentation for this class was generated from the following file: