Boost C++ 库

...世界上最受推崇和设计精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

函数模板 move - Boost C++ 函数库
PrevUpHomeNext

函数模板 move

boost::move

提要

// In header: <boost/move/algo/move.hpp>


template<typename I, typename O> O move(I f, I l, O result);

描述

效果:将范围 [first,last) 中的元素移动到范围 [result,result + (last - first)) 中,从 first 开始到 last 结束。对于每个非负整数 n < (last-first),执行 *(result + n) = boost::move (*(first + n))。

效果:result + (last - first)。

要求:result 不得位于范围 [first,last) 中。

复杂度:精确的 last - first 次移动赋值。


PrevUpHomeNext