HomeManualTopicsTypesSymbols

std::range

returns a subrange of a collection

Parameters

collection
the collection to be analyzed
start
the first item to be included
end
the first item to be excluded

Result

range
the subrange

Description

The first argument specifies the collection.

The second argument specifies the first index of the first item to include in the subrange.

The third argument specifies the last index of the first item to include in the subrange.

It is okay if the subrange is empty:

first_index == last_index + 1

It is an error if the size of the subrange would be negative:

first_index > last_index + 1

If an index is negativ it is counted from the end of the collection.

So -1 denotes the last item of the collection, -2 denotes the next-to-last item and so on.

Topics

Strings

Lists

Implemented by

std_types::list returns the specified subrange of the specified list
std_types::octet_string returns a string containing the specified subrange
std_types::quad_octet_string returns a string containing the specified subrange