Medium
CTAD for a class template with an iterator-pair constructor
What happens when this program is compiled?
main.cpp
#include <iostream>
#include <vector>
template <typename T>
struct Wrapper {
std::vector<T> data;
template <typename Iter>
Wrapper(Iter first, Iter last) : data(first, last) {}
};
int main() {
std::vector<int> v = {1, 2, 3};
Wrapper w(v.begin(), v.end());
std::cout << w.data.size() << std::endl;
}44 of 117 in C++