copy 函数
Visual Studio 2012
将 c + + 的存储系统对象。满足所有同步数据传输的要求。加速器上运行代码时,您不能复制数据。此函数的常规形式是copy(src, dest)。
template < typename _Value_type, int _Rank > void copy( const array<_Value_type, _Rank>& _Src, array<_Value_type, _Rank>& _Dest ); template < typename InputIterator, typename _Value_type, int _Rank > void copy( InputIterator _SrcFirst, InputIterator _SrcLast, array<_Value_type, _Rank> &_Dest ); template < typename InputIterator, typename _Value_type, int _Rank > void copy( InputIterator _SrcFirst, array<_Value_type, _Rank> &_Dest ); template < typename OutputIterator, typename _Value_type, int _Rank > void copy( const array<_Value_type, _Rank> &_Src, OutputIterator _DestIter ); template < typename _Value_type, int _Rank > void copy( const array<_Value_type, _Rank>& _Src, array_view<_Value_type, _Rank>& _Dest ); template < typename _Value_type, int _Rank > void copy( const array_view<const _Value_type, _Rank>& _Src, array<_Value_type, _Rank>& _Dest ); template < typename _Value_type, int _Rank > void copy( const array_view<_Value_type, _Rank>& _Src, array<_Value_type, _Rank>& _Dest ); template < typename _Value_type, int _Rank > void copy( const array_view<const _Value_type, _Rank>& _Src, array_view<_Value_type, _Rank>& _Dest ); template < typename _Value_type, int _Rank > void copy( const array_view<_Value_type, _Rank>& _Src, array_view<_Value_type, _Rank>& _Dest ); template < typename InputIterator, typename _Value_type, int _Rank > void copy( InputIterator _SrcFirst, InputIterator _SrcLast, array_view<_Value_type, _Rank> &_Dest ); template < typename InputIterator, typename _Value_type, int _Rank > void copy( InputIterator _SrcFirst, array_view<_Value_type, _Rank> &_Dest ); template < typename OutputIterator, typename _Value_type, int _Rank > void copy( const array_view<_Value_type, _Rank> &_Src, OutputIterator _DestIter );
复制操作始终执行深层副本。
如果不匹配的源和目标对象的扩展盘区, runtime_exception 引发。
您可以将其复制到数组 和 array_view 对象从以下来源:
-
array或array_view的目标位置具有相同的秩和元素类型的array或array_view。
-
其元素类型与目标相同标准容器array或array_view。公开的容器size()和data()成员更有效地执行。