首页 > 编程 > C++ > 正文

c++ STL函数

2019-11-06 08:11:29
字体:
来源:转载
供稿:网友

c++ 无法通过 auto编译

g++ -std=c++11 test.cpp

find

template <class InputIterator, class T>InputIterator find (InputIterator first, InputIterator last, const T& val);

Returns an iterator to the first element in the range [first,last) that compares equal to val. If no such element is found, the function returns last. http://www.cplusplus.com/reference/algorithm/find/

copy

template <class InputIterator, class OutputIterator>OutputIterator copy (InputIterator first, InputIterator last, OutputIterator result);

Copies the elements in the range [first,last) into the range beginning at result. http://www.cplusplus.com/reference/algorithm/copy/

copy_backward

template <class BidirectionalIterator1, class BidirectionalIterator2>BidirectionalIterator2 copy_backward (BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result);

Bidirectional iterators to the initial and final positions in a sequence to be copied. The range used is [first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by last. 从result指针的前一位开始,result指针前一位用last指针的前一位代替,result指针前2位用last指针的前2位代替. http://www.cplusplus.com/reference/algorithm/copy_backward/


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选