User:Cooky/ranges/to

The overloads of range conversion function construct a new non-view range object from an input range as its first argument by calling a constructor taking a range, a tagged constructor, or a constructor taking an iterator-sentinel pair, or by back inserting each element of the range into the arguments-constructed object.

It is allowed to apply recursively, allowing the conversion of a range of ranges. (e.g. ).

@1@ constructs an object of type from the elements of  in the following:
 * @a@ If is :
 * @1@ if  is.
 * @2@ Otherwise, if  is.
 * @3@ Otherwise, if all of them are :


 * satisfies
 * @4@ Otherwise:
 * @4@ Otherwise:
 * @4@ Otherwise:

If both of them are :
 * @b@ Otherwise:
 * @b@ Otherwise:
 * @b@ Otherwise:

If is. Otherwise, the program is ill-formed.

@2@ constructs an object of deduced type from the elements of. Let be an exposition only type and satisfies :

Let be defined as follows: The call is equivalent to. @3-4@ returns a perfect forwarding call wrapper that is also a range adaptor closure object. @5@ The exposition-only variable template is  if it satisfies  and is eligible to be reservable. @6@ The exposition-only variable template is  if  is back insertable by a member function call  or. @7@ The exposition-only function template returns  if member function  is available, otherwise. @8@ The exposition-only concept is used in the definition of containers in constructing an input range  and its range reference must be convertible to.
 * , if that expression is valid.
 * Otherwise,, if that expression is valid.
 * Otherwise,, if that expression is valid.
 * Otherwise, the program is ill-formed.

Return value
@1-2@ a constructed non-view range object @3-4@ a range adaptor closure object, with the following properties:
 * It has no target object
 * Its bound arguments consist of objects of types  direct non-list initialized with, respectively.
 * Its call pattern is, where:
 * is the argument used in the function call expression of the range adaptor closure.
 * The template argument is (3) or (4) the deduced type from a class template  that is not a.

Exceptions
Only throws if construction of a range object throws.