Hello,
I don't really understand why code below is working. What I don't understand is why can I swap strings using swap() with double parameters. How is it possible?
Thanks for your answers.
Your program will call std::swap which has a built-in specialisation for std::string
I believe this is entirely due to ADL as JLBorges says. Besides, the reference section doesn't indicate that there is a specialization for swapping strings.
[ Edit - the page that Chervil linked for string does describe the specialization. ]
A function instantiated from a function template is called a function template specialization;
so is an explicit specialization of a function template. - IS