添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Filesystem library (C++17) Regular expressions library (C++11) Concurrency support library (C++11) Technical specifications Symbols index External libraries
Algorithm library
Constrained algorithms and algorithms on ranges (C++20)
Constrained algorithms, e.g. ranges::copy , ranges::sort , ...
Execution policies (C++17)
Non-modifying sequence operations
(C++11) (C++11) (C++11)
(C++17)
Modifying sequence operations
(C++11)
(C++11)
(C++20) (C++20)
(C++17)
(until C++17)
(C++11)
Partitioning operations
Sorting operations
(C++11)
Binary search operations
Set operations (on sorted ranges)
Heap operations
(C++11)
is_heap_until
(C++11)
Minimum/maximum operations
(C++11)
(C++17)
Permutations
Numeric operations
(C++11)
(C++17)
Operations on uninitialized storage
(C++17)
(C++17)
(C++17)
(C++17)
C library
Constrained algorithms
Non-modifying sequence operations
Modifying sequence operations
ranges::copy ranges::copy_if
Partitioning operations
Sorting operations
Binary search operations
Set operations (on sorted ranges)
Heap operations
Minimum/maximum operations
Permutations
Numeric operations
Fold operations
Operations on uninitialized storage
Return types
Defined in header <algorithm>
template < std:: input_iterator I, std:: sentinel_for < I > S, std:: weakly_incrementable O >

requires std:: indirectly_copyable < I, O >
constexpr copy_result < I, O >
copy ( I first, S last, O result ) ;

(since C++20)
template < ranges:: input_range R, std:: weakly_incrementable O >

requires std:: indirectly_copyable < ranges:: iterator_t < R > , O >
constexpr copy_result < ranges:: borrowed_iterator_t < R > , O >
copy ( R && r, O result ) ;

(since C++20)
template < std:: input_iterator I, std:: sentinel_for < I > S, std:: weakly_incrementable O,

class Proj = std:: identity ,
std:: indirect_unary_predicate < std :: projected < I, Proj >> Pred >
requires std:: indirectly_copyable < I, O >
constexpr copy_if_result < I, O >
copy_if ( I first, S last, O result, Pred pred, Proj proj = { } ) ;

(since C++20)
template < ranges:: input_range R, std:: weakly_incrementable O,

class Proj = std:: identity ,
std:: indirect_unary_predicate <
std :: projected < ranges:: iterator_t < R > , Proj >> Pred >
requires std:: indirectly_copyable < ranges:: iterator_t < R > , O >
constexpr copy_if_result < ranges:: borrowed_iterator_t < R > , O >
copy_if ( R && r, O result, Pred pred, Proj proj = { } ) ;

(since C++20)
Helper types

Copies the elements in the range, defined by [ first , last ) , to another range beginning at result .

1) Copies all elements in the range [ first , last ) starting from first and proceeding to last - 1 . The behavior is undefined if result is within the range [ first , last ) . In this case, ranges::copy_backward may be used instead.
3) Only copies the elements for which the predicate pred returns true . The relative order of the elements that are copied is preserved. The behavior is undefined if the source and the destination ranges overlap.
2,4) Same as (1,3) , but uses r as the source range, as if using ranges:: begin ( r ) as first and ranges:: end ( r ) as last .

The function-like entities described on this page are niebloids , that is: