|
|
|
|
|
by ghostwriter
1221 days ago
|
|
> For example using the return type to deduce type parameters for a method like let samples: Vec<_> = iterator.collect(); > C++ doesn't support it How exactly is it different? #include <iostream>
#include <vector>
int main() {
std::vector<int> v1 = {1,2,3};
auto it = v1.begin();
std::vector v2 (it + 1, it + 2);
for (auto i: v2) { std::cout << i << ' '; }
}
|
|