Closed eugenefil closed 7 months ago
On p.41 in 17.Iterators_Containers_Alg.pdf under title "std::span":
- std::array2<int, 3> array2 = {1, 2, 3}; + std::array<int, 3> array2 = {1, 2, 3}; std::span s2{array2}; // static extent auto array3 = new int[3]; - std::span s3{array3}; // dynamic extent + std::span s3{array3, 3}; // dynamic extent std::vector<int> v{1, 2, 3}; std::span s4{v.data(), v.size()}; // dynamic extent + + std::span s5{v}; // dynamic extent
In hunk order:
thanks, @eugenefil. I didn't know that std::span can be created starting directly from a std::vector. I will add it
std::span
std::vector
On p.41 in 17.Iterators_Containers_Alg.pdf under title "std::span":
In hunk order: