Exception handling syntax: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit
Haskell: I have no idea what genius wrote this but it doesn’t even compile.
Tags: Mobile edit Mobile web edit
Line 433:
 
<syntaxhighlight lang="cpp">
import std;
#include <iostream>
 
using namespace std;
int main() {
try {
{
throw static_cast<int>(42);
try
{throw} catch(intdouble e)42;} {
std::println("(0,{})", e);
catch(double e)
{cout} << "catch(0," <<int e << ")" << endl;}{
std::println("(1,{})", e);
catch(int e)
}
{cout << "(1," << e << ")" << endl;}
}
</syntaxhighlight>