std::at_quick_exit
cppreference.com
<tbody>
</tbody>
int at_quick_exit( /*atexit-*/* func ) noexcept; int at_quick_exit( /*c-atexit-*/* func ) noexcept; |
(1) | ( C++11) |
extern "C++" using /*atexit-*/ = void(); extern "C" using /*c-atexit-*/ = void(); |
(2) | ( *) |
func , ( std::quick_exit).
. 32 . .
. , std::atexit.
| func | , . |
0, , .
#include <cstdlib>
#include <iostream>
void f1()
{
std::cout << " " << std::endl; //
}
extern "C" void f2()
{
std::cout << " \n";
}
int main()
{
auto f3 = []
{
std::cout << " \n";
};
std::at_quick_exit(f1);
std::at_quick_exit(f2);
std::at_quick_exit(f3);
std::quick_exit(0);
}
:
| ( ) () | |
| () | |
| , std::exit() () | |
(C++11) |
() |
C at_quick_exit
| |