Heterogeneous fixed-length container. That is, the types contained can all be different, and the list of types is given explicitly as template parameters.
The container can be constructed in three ways. One is default construction. The next is construction from a value for each contained type. The third is construction from another range. If the length of this range is known at compile time to be of the same length and all elements can be implicitly converted, this constructor is implicit. If the length of this range is not know at compile time and/or not all elements can be implicitly converted (though the types must be constructible), then the constructor is explicit.
The implementation aims to instantiate as few template classes as possible.
Unlike for std::tuple, there is no get function; its functionality is provided by range::at and range::at_c.
Tuples can be compared for equality and order. They are equal if the number of elements is equal and the elements compare equal in parallel. The ordering operators perform lexicographical comparison. Views on tuples do not define comparison operators.
The layout of the elements in memory is undefined. Connected with this is the layout
Public Functions
Default-construct all elements. This is provided only if all elements are default-constructible.
Construct element-wise. Each type must be constructible from the corresponding argument passed in.
The order in which the elements are constructed is not defined.
Construct from another range. If the range is known to be the same length, and the types are pairwise convertible, then this implicit constructor is provided.
The order in which the range is traversed and in which the elements are constructed is not defined.
Construct from another range. If the range is not known to be the same length, or the types are pairwise constructible but not convertible, then this explicit constructor is provided.
The order in which the range is traversed and in which the elements are constructed is not defined.
Iff the size of the range passed in is not the size of this.
Assign from another range.
If traversal of the range or assignment of any element throws an exception, then it is not defined which elements will have their new values and which ones do not.
Iff the size of the range passed in is not the size of this.
Call swap (found with argument-dependent lookup or using std::swap) for each pair of elements.
Make a tuple from the arguments passed in.
The arguments are stripped of qualifications.
This is equivalent to std::make_tuple except that it returns a range::tuple.
Make a tuple from the range passed in, stripping the types of qualifications.
The range is traversed in direction::front. The range must be known to end after a fixed number of elements. This could be a heterogeneous container, like std::tuple. It could also be an adapted heterogeneous container.
For a variable-length range, the resulting tuple has the longest number of elements possible. If range is a standard homogeneous container, this is obviously impossible, and a compile error about recursive template instantiations will result.
If the range turns out at run time to finish sooner than it should. In this case, the tuple type will have more elements than the range turns out to have, so constructing the tuple type elicits the exception.
The range to construct the range from.
Make a tuple of references to each of the arguments.
This is equivalent to std::tie except that it returns a range::tuple.
Make a tuple of references to the elements of the range passed in.
The range is traversed in direction::front. The range must be known to end after a fixed number of elements. This could be a heterogeneous container, like std::tuple. It could also be an adapted heterogeneous container.
For a variable-length range, the resulting tuple has the longest number of elements possible. If range is a standard homogeneous container, this is obviously impossible, and a compile error about recursive template instantiations will result.
If the range turns out at run time to finish sooner than it should. In this case, the tuple type will have more elements than the range turns out to have, so constructing the tuple type elicits the exception.
The range to construct the range from.
Make a tuple of rvalue references to each of the arguments.
This is equivalent to std::forward_as_tuple except that it returns a range::tuple.
Make a tuple that is a copy of the range passed in, down to the exact element types that first() returns.
The types will often be references. Notably, copy_tuple_from applied to a tuple will usually result in a tuple with a different type.
The range is traversed in direction::front. The range must be known to end after a fixed number of elements. This could be a heterogeneous container, like std::tuple. It could also be an adapted heterogeneous container.
For a variable-length range, the resulting tuple has the longest number of elements possible. If range is a standard homogeneous container, this is obviously impossible, and a compile error about recursive template instantiations will result.
If the range turns out at run time to finish sooner than it should. In this case, the tuple type will have more elements than the range turns out to have, so constructing the tuple type elicits the exception.
The range to construct the range from.
Object that anything can be assigned to syntactically, but it has no effect. This is useful in conjunction with tie. std::ignore could be used just as well, but this can be awkward in practice. Because of argument-dependent lookup, is ambiguous between range::tie and std::tie.
using range::tie; tie (std::ignore);
On the other hand, is fine.
using range::tie; tie (range::ignore);
Return an infinite range that contains an arithmetic progression of integers.
It starts with begin, the next element is begin + 1, etc. If begin is a run-time value, then the range is homogeneous, i.e., the other elements have the same type. If begin is a constant, the other elements are also constants of the same type. However, if begin is a constant and drop (increment, r) is called with non-constant increment, then the resulting range will have a run-time value of the same type as the value type of the original constant.
Return a range that contains an arithmetic progression of integers.
It starts with begin, and finishes one before end. begin and end can be run-time values or compile-time values. If they are run-time values, like int, then the resulting range is homogeneous. If not, then the range is heterogeneous.
First value in the range.
One-past-last value in the range.
Return a range with end elements that starts with 0.
If end is a run-time value, then the range is homogeneous. If end is a constant, then the range is heterogeneous.
One-past-last value in the range.
Return an infinite range starting from 0.
This is equivalent to count_from (std::size_t (0)).
Create a range whose elements are the results of consecutive function calls.
The resulting range implements operations on rvalues only: it is not possible to make a copy of it. The range is noncopyable, but movable.