| Home | Libraries | People | FAQ | More

#### Function join

The intention of the `join` function is to join two ranges into one longer range.

The resultant range will have the lowest common traversal of the two ranges supplied as parameters.

Note that the joined range incurs a performance cost due to the need to check if the end of a range has been reached internally during traversal.

##### Synposis

    template<typename SinglePassRange1, typename SinglePassRange2>
    iterator_range<range_detail::join_iterator<
        typename range_iterator<const SinglePassRange1>::type,
        typename range_iterator<const SinglePassRange2>::type,
        typename add_const<
            typename range_value<const SinglePassRange1>::type>::type>
    >
    join(const SinglePassRange1& rng1, const SinglePassRange2& rng2)

    template<typename SinglePassRange1, typename SinglePassRange2>
    iterator_range<range_detail::join_iterator<
        typename range_iterator<SinglePassRange1>::type,
        typename range_iterator<SinglePassRange2>::type,
        typename range_value<SinglePassRange1>::type>
    >
    join(SinglePassRange1& rng1, SinglePassRange2& rng2);

##### Example

The expression `join(irange(0,5), irange(5,10))` would evaluate to a range representing an integer range `[0,10)`