insert.qbk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. [/
  2. Copyright 2010 Neil Groves
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. /]
  6. [section:insert insert]
  7. [heading Prototype]
  8. ``
  9. template<
  10. class Container,
  11. class SinglePassRange
  12. >
  13. Container& insert(Container& target,
  14. typename Container::iterator before,
  15. const SinglePassRange& from);
  16. // This overload is for target containers that do not require an insertion
  17. // position e.g. set/map
  18. template<
  19. class Container,
  20. class SinglePassRange
  21. >
  22. Container& insert(Container& target, const SinglePassRange& from);
  23. ``
  24. [heading Description]
  25. `insert` all of the elements in the range `from` before the `before` iterator into `target`.
  26. [heading Definition]
  27. Defined in the header file `boost/range/algorithm_ext/insert.hpp`
  28. [heading Requirements]
  29. # `SinglePassRange` is a model of the __single_pass_range__ Concept.
  30. # `Container` supports insert at a specified position.
  31. # `SinglePassRange`'s value type is convertible to `Container`'s value type.
  32. [heading Complexity]
  33. Linear. `distance(from)` assignments are performed.
  34. [endsect]