| 1158 | //! <b>Complexity</b>: Linear to n. |
| 1159 | template <class InIt> |
| 1160 | void assign(InIt first, InIt last |
| 1161 | BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_or |
| 1162 | < void |
| 1163 | BOOST_MOVE_I container_detail::is_convertible<InIt BOOST_MOVE_I size_type> |
| 1164 | BOOST_MOVE_I container_detail::and_ |
| 1165 | < container_detail::is_different<alloc_version BOOST_MOVE_I version_0> |
| 1166 | BOOST_MOVE_I container_detail::is_not_input_iterator<InIt> |
| 1167 | > |
| 1168 | >::type * = 0) |
| 1169 | ) |
| 1170 | { |
| 1171 | //Overwrite all elements we can from [first, last) |
| 1172 | iterator cur = this->begin(); |
| 1173 | const iterator end_it = this->end(); |
| 1174 | for ( ; first != last && cur != end_it; ++cur, ++first){ |
| 1175 | *cur = *first; |
| 1176 | } |
| 1177 | |
| 1178 | if (first == last){ |
| 1179 | //There are no more elements in the sequence, erase remaining |
| 1180 | T* const end_pos = this->back_raw(); |
| 1181 | const size_type n = static_cast<size_type>(end_pos - container_detail::iterator_to_raw_pointer(cur)); |
| 1182 | this->priv_destroy_last_n(n); |
| 1183 | } |
| 1184 | else{ |
| 1185 | //There are more elements in the range, insert the remaining ones |
| 1186 | this->insert(this->cend(), first, last); |
| 1187 | } |
| 1188 | } |
| 1189 | |
| 1190 | #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) |
| 1191 | //! <b>Effects</b>: Assigns the the range [il.begin(), il.end()) to *this. |
no test coverage detected