Boost C++ 库

“……世界上最受推崇和设计最精良的 C++ 库项目之一。” Herb SutterAndrei Alexandrescu, 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