std::at_quick_exit

cppreference.com

Example

f1: () = {
    std::cout << "pushed first" << std::endl; // flush is intentional
}

extern "C" void f2()
{
    std::cout << "pushed second\n";
}

main: () = {
    f3:= :() = {
        std::cout << "pushed third\n";
    };
 
    std::at_quick_exit(f1);
    std::at_quick_exit(f2);
    std::at_quick_exit(f3);
    std::quick_exit(0);
}

Output

pushed third
pushed second
pushed first

Back to top

cpp2reference.com licensed under CC-BY-SA and GFDL.