The standard i(range-based for-loop) requires for its range-specificiation an
array, an initializer list, or an iterator range as offered by, e.g.,
containers (through their tt(begin) and tt(end) members).

Ranges defined by a  pointer pair or by a subrange defined by iterator
expressions cannot currently be used in combination with range-based
for-loops.

The ti(Ranger) class template developed in this section defines ranges that
can be used with range-based for-loops.  tt(Ranger) extends the applicability
of range-based for-loops by turning pointer pairs,, an initial pointer or
iterator and a pointer count, or a pair of iterators into a range that can be
used by range-based for-loops. The tt(Ranger) class template can also be used
to process a pair of reverse iterators, normally not supported by range-based
for-loops.

The tt(Ranger) class template requires but one template type parameter:
tt(Iterator), representing an iterator or pointer type reaching the data when
dereferenced. In practical applications users don't have to specify
tt(Ranger)'s template type. The function template tt(ranger) deduces the
required tt(Iterator) type and returns the appropriate tt(Ranger) object.

The tt(ranger) function template can be used in various ways:
    itemization(
    itt(Ranger<Iterator> ranger(Iterator const &begin, Iterator const &end))
        this function template returns a tt(Ranger) object for the (sub)range
        defined by two (reverse) iterators. Its definition is:
        verb(
template <typename Iter>
Ranger<Iter> ranger(Iter &&begin, Iter &&end)
{
    return Ranger<Iter>{ begin, end };
}
            )
    itt(Ranger<Iterator> ranger(Iterator const &begin, size_t count))
        this function template returns a tt(Ranger) object for the (sub)range
        defined by the (reverse) iterator range tt(begin) and tt(begin +
        count).
        Its definition is:
    verb(
template <typename Data>
Ranger<Data *> ranger(Data *begin, Data *end)
{
    return Ranger<Data *>{ begin, end };
}
        )
    itt(Ranger<Data> ranger(Data *begin, Data *end))
        this function template returns a tt(Ranger) object for the (sub)range
        defined by the two pointers tt(begin) and tt(end).
        Its definition is:
    verb(
template <typename Iter>
Ranger<Iter> ranger(Iter &&begin, size_t count)
{
    return Ranger<Iter>{ begin, begin + count };
}
        )
    itt(Ranger<Data> ranger(Data *begin, size_t count))
        this function template returns a tt(Ranger) object for the (sub)range
        defined by the two pointers tt(begin) and tt(begin + count).
        Its definition is:
    verb(
template <typename Data>
Ranger<Data *> ranger(Data *begin, size_t count)
{
    return Ranger<Data *>{ begin, begin + count};
}
        )
    )

The tt(Ranger) class template itself offers a constructor expecting two
tt(Iterator const &) parameters, where tt(Iterator) is tt(Ranger)'s template
type parameter. Although named 'Iterator' it can also be a pointer to some
data type (e.g., tt(std::string *)).

The class only needs two members, tt(begin) and tt(end), since these are the
only members called by range-based for-loops. These members can be tt(const)
members, returning tt(Iterator const) references. This also is the required
return type if tt(Iterator) itself was a pointer type (like tt(int *)). Since
a `tt(Iterator const &)' does not imply that the dereferenced tt(Iterator) is
immutable, the data to which the iterator returned by tt(begin()) can actually
be modified, if tt(Iterator) unless tt(Iterator) is a tt(Type const *) or a
tt(const_iterator) type.

    If reverse iterators are passed to tt(Ranger)'s constructor (the reversed
begin iterator should be passed as tt(Ranger) constructor's first argument,
the reversed end iterator as its second argument), then tt(Ranger)'s tt(begin)
and tt(end) members return em(reverse iterators). Since the intended use of
tt(Ranger) objects is to define a range for range-base for-loops, members like
tt(rbegin) and tt(rend) were omitted from tt(Ranger)'s interface.

    Here is tt(Ranger)'s implementation (using in-class implementations for
brevity):
        verb(
    template <typename Iter>
    class Ranger
    {
        Iter d_begin;
        Iter d_end;

        public:
            Ranger(Iter const &begin, Iter const &end)
            :
                d_begin(begin),
                d_end(end)
            {}

            Iter const &begin() const
            {
                return d_begin;
            }

            Iter const &end() const
            {
                return d_end;
            }
    };
        )
    Using tt(ranger) is easy. Here is an example of a program displaying a
program's command-line arguments using a range-based for-loop:
        verb(
    // insert all required declarations here

    int main(int argc, char **argv)
    {
        for (auto ptr: ranger(argv, argc))
            cout << ptr << '\n';
    }
        )
