Why does this code run successfully on g++ and clang (libstdc++) but give a segmentation fault with libc++:
#include <iostream>
int main()
{
std::cout.tie(&std::cout);
std::cout << 123;
}
What I think should happen is that std::cout.flush()
should be called before the output actually occurs. Why would this give a segmentation fault?
Aucun commentaire:
Enregistrer un commentaire