*Preconditions*

*Preconditions*

For the first version:

*• [first1, last1)* is a valid range.

*• [first1, last1)* is in ascending order. That is, for every pair of iterators *i* and *j* in *[first1, last1)* such that *i* precedes *j*, **j < *i* is *false*.

*• [first2, last2)* is a valid range.

*• [first2, last2)* is in ascending order. That is, for every pair of iterators *i* and *j* in *[first2, last2)* such that *i* precedes *j*, **j < *i* is *false*.

• The ranges *[first1, last1)* and *[result, result + (last1 – first1) + (last2 – first2))* do not overlap.

• The ranges *[first2, last2)* and *[result, result + (last1 – first1) + (last2 – first2))* do not overlap.

• There is enough space to hold all of the elements being copied. More formally, the requirement is that *[result, result + (last1 – first1) + (last2 – first2))* is a valid range.

For the second version:

*• [first1, last1)* is a valid range.

*• [first1, last1)* is in ascending order. That is, for every pair of iterators *i* and *j* in *[first1, last1)* such that *i* precedes *j*, *comp(*j, *i)* is *false*.

*• [first2, last2)* is a valid range.

*• [first2, last2)* is in ascending order. That is, for every pair of iterators *i* and *j* in *[first2, last2)* such that *i* precedes *j*, *comp(*j, *i)* is *false*.

• The ranges *[first1, last1)* and *[result, result + (last1 – first1) + (last2 – first2))* do not overlap.

• The ranges *[first2, last2)* and *[result, result + (last1 – first1) + (last2 – first2))* do not overlap.

• There is enough space to hold all of the elements being copied. More formally, the requirement is that *[result, result + (last1 – first1) + (last2 – first2))* is a valid range.