Explain the differences between the constructor that takes a container to copy and the constructor that takes two iterators
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:9| Question number:12
All Answers
total answers (1)
The constructor that takes a container to copy requires the container type and the element type of the two containers are both match exactly.
The constructor that takes two iterators requires the element type of the source container must be compatible with the element type of the destiny container For example,
The requirement of the former constructor is stricter than the latter.
need an explanation for this answer? contact us directly to get an explanation for this answer