...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Copy a sequence src
to
a sequence dest
. It is
also used to convert sequence into other.
template <typename Seq1, typename Seq2> void copy(Seq1 const& src, Seq2& dest);
Table 1.37. Parameters
Parameter |
Requirement |
Description |
---|---|---|
|
A model of Forward
Sequence, all elements contained in the |
Operation's argument |
|
A model of Forward
Sequence, |
Operation's argument |
copy
(src, dest);
Return type: void
Semantics: e2
= e1
for each element e1
in
src
and e2
in dest
.
Linear, exactly
.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/auxiliary/copy.hpp> #include <boost/fusion/include/copy.hpp>
vector
<int,int> vec(1,2);list
<int,int> ls;copy
(vec, ls); assert(ls ==make_list
(1,2));