| 619 | } |
| 620 | |
| 621 | iterator insert(iterator position, const T &value, command_queue &queue) |
| 622 | { |
| 623 | if(position == end()){ |
| 624 | resize(m_size + 1, queue); |
| 625 | position = begin() + position.get_index(); |
| 626 | ::boost::compute::copy_n(&value, 1, position, queue); |
| 627 | } |
| 628 | else { |
| 629 | ::boost::compute::vector<T, Alloc> tmp(position, end(), queue); |
| 630 | resize(m_size + 1, queue); |
| 631 | position = begin() + position.get_index(); |
| 632 | ::boost::compute::copy_n(&value, 1, position, queue); |
| 633 | ::boost::compute::copy(tmp.begin(), tmp.end(), position + 1, queue); |
| 634 | } |
| 635 | |
| 636 | return position + 1; |
| 637 | } |
| 638 | |
| 639 | iterator insert(iterator position, const T &value) |
| 640 | { |