| 557 | } |
| 558 | |
| 559 | iterator insert(iterator position, const T &value, command_queue &queue) |
| 560 | { |
| 561 | if(position == end()){ |
| 562 | resize(m_size + 1, queue); |
| 563 | position = begin() + position.get_index(); |
| 564 | ::boost::compute::copy_n(&value, 1, position, queue); |
| 565 | } |
| 566 | else { |
| 567 | ::boost::compute::vector<T, Alloc> tmp(position, end(), queue); |
| 568 | resize(m_size + 1, queue); |
| 569 | position = begin() + position.get_index(); |
| 570 | ::boost::compute::copy_n(&value, 1, position, queue); |
| 571 | ::boost::compute::copy(tmp.begin(), tmp.end(), position + 1, queue); |
| 572 | } |
| 573 | |
| 574 | return position + 1; |
| 575 | } |
| 576 | |
| 577 | iterator insert(iterator position, const T &value) |
| 578 | { |