Пятница, 26 марта 2021, 21:48 +03:00 от Vladimir Grigoriev via Std-Discussion <std-discussion@lists.isocpp.org>:
I am sorry. I made an incorrect resume about the error. Nevertheless the questions about implicit constructor are actual.Пятница, 26 марта 2021, 21:33 +03:00 от Vladimir Grigoriev via Std-Discussion <std-discussion@lists.isocpp.org>:
Consider the following code snippet.int x = 10;
std::reference_wrapper<int> rx( x );
std::swap( rx, x );
The compiler will issue an error because either rx can be implicitly converted to the type int or x can be implicitly converted to the type std::reference_wrapper<int>.So a pair of questions are arising.Should the constructor of the class template std::reference_wrapper be explicit?What is the reason that the constructor is implicit? Is that so necessary?--
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion--
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion