[#1946] T.65 Fix two typos (#1956)

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.
pull/1967/head
Nikolay Panov 3 years ago committed by GitHub
parent 444704f703
commit be1722ad0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18248,7 +18248,7 @@ This is a simplified version of `std::copy` (ignoring the possibility of non-con
template<class Iter>
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)
@ -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:
template<class Iter>
requires Pod<Value_type<iter>>
requires Pod<Value_type<Iter>>
Out copy_helper(In, first, In last, Out out)
{
// use memmove

Loading…
Cancel
Save