Why is std::endl generating this cryptic error message?
问题 If I try to compile the following code I get the following compiler error (see code.) It compiles without error if std::endl is removed. #include <iostream> #include <sstream> #include <utility> namespace detail { template <class T> void print(std::ostream& stream, const T& item) { stream << item; } template <class Head, class... Tail> void print(std::ostream& stream, const Head& head, Tail&&... tail) { detail::print(stream, head); detail::print(stream, std::forward<Tail>(tail)...); } }