How to make constructor accept all type of iterators?
问题 I am creating a custom Vector/ArrayList class. But i´m having troubles creating the iterative version of the constructor. The following code works, but the problem is when i want to create ArrayList like this: ArrayList arr(1, 5); The compiler doesn't know what version of the function should pick. How can I solve this? The constructors: ArrayList(const size_type elem_amount, value_type elem) : arr_size { elem_amount }, arr_capacity{ elem_amount } { array = std::uninitialized_fill_n(allocator