Ben çıktı üretmesi Linux üzerinde gcc 5.3 çalışırcout gösterilmeyen
That was unexpected
görmüyorum, Windows 10 üzerinde Visual Studio 2015 bu kodu çalıştırdığınızda.
class X {};
class Y {};
class Z : public X {};
class W {};
void f() throw(X, Y) // list what exceptions can be thrown
{
int n = 0;
if (n) throw X(); // OK
if (n) throw Z(); // also OK
throw W(); // will call std::unexpected()
}
int main() {
std::set_unexpected([] {
std::cout << "That was unexpected" << std::endl;
std::abort();
});
f();
}
Bunun yerine "std :: cerr" yazmayı deneyebilirsiniz. –
Std :: cerr'i şimdi denedim ama hala çalışmıyor. – Damian