Modernes C++ programmieren

Okt 20, 2024

lst-0003-book.cpp

// https://godbolt.org/z/veEq4dcET 
struct Day {
    Day(int a, int b) : Day{} {       // delegates
        if(a==0 || b == 0)
            throw 666;                // throws exception
    }
    Day() {}
};
int main() {
    try {
        Day day{1,2};
    } catch(int) { }
}