[Bug c++/80662] libstdc++ basic_string casting oddity
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon May 8 13:26:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80662
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced thanks to K-ballo:
extern "C" int puts(const char*);
template<typename C, typename T>
void operator<<(C&&, T const&) { puts("non-member"); }
struct my_stream {
template <typename T>
void operator<<(T&&) { puts("member"); }
};
int main()
{
my_stream{} << "hello world";
}
More information about the Gcc-bugs
mailing list