Functions vector_swap¶
-
template<class
vec_t
, classvec2_t
, classdata_t
>
voido2scl
::
vector_swap
(size_t N, vec_t &v1, vec2_t &v2)¶ Swap the first
N
elements of two vectors.This function swaps the elements of
v1
andv2
, one element at a time.
-
template<class
vec_t
, classvec2_t
, classdata_t
>
voido2scl
::
vector_swap
(vec_t &v1, vec2_t &v2)¶ Swap all elements in two vectors.
This function swaps the elements of
v1
andv2
, one element at a time.- Note
It is almost always better to use
std::swap
than this function, which is provided only in cases where one knows one is going to be forced to use a vector type without a properly definedstd::swap
method.