mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
Fixes #1946: - copy_trait type argument needs to be a container element type. Use Value_type<Iter> like in other examples. - Fix name typo in the definition of copy_helper.
This commit is contained in:
@@ -18248,7 +18248,7 @@ This is a simplified version of `std::copy` (ignoring the possibility of non-con
|
|||||||
template<class Iter>
|
template<class Iter>
|
||||||
Out copy(Iter first, Iter last, Iter out)
|
Out copy(Iter first, Iter last, Iter out)
|
||||||
{
|
{
|
||||||
return copy_helper(first, last, out, typename copy_trait<Iter>::tag{})
|
return copy_helper(first, last, out, typename copy_trait<Value_type<Iter>>::tag{})
|
||||||
}
|
}
|
||||||
|
|
||||||
void use(vector<int>& vi, vector<int>& vi2, vector<string>& vs, vector<string>& vs2)
|
void use(vector<int>& vi, vector<int>& vi2, vector<string>& vs, vector<string>& vs2)
|
||||||
@@ -18264,7 +18264,7 @@ This is a general and powerful technique for compile-time algorithm selection.
|
|||||||
When `concept`s become widely available such alternatives can be distinguished directly:
|
When `concept`s become widely available such alternatives can be distinguished directly:
|
||||||
|
|
||||||
template<class Iter>
|
template<class Iter>
|
||||||
requires Pod<Value_type<iter>>
|
requires Pod<Value_type<Iter>>
|
||||||
Out copy_helper(In, first, In last, Out out)
|
Out copy_helper(In, first, In last, Out out)
|
||||||
{
|
{
|
||||||
// use memmove
|
// use memmove
|
||||||
|
|||||||
Reference in New Issue
Block a user