首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::at_quick_exit

Defined in header <cstdlib>

int at_quick_exit( /*atexit-handler*/* func ); int at_quick_exit( /*c-atexit-handler*/* func );

(1)

(since C++11)

extern "C++" using /*atexit-handler*/ = void(); // exposition-only extern "C" using /*c-atexit-handler*/ = void(); // exposition-only

(2)

注册所指向的函数。func在快速程序终止%28via时被调用std::quick_exit29%。

从多个线程调用函数并不会引发数据竞争。实施应至少支持登记32职能。

将不调用已注册的函数。正常程序终止如果在这种情况下需要调用函数,std::atexit一定要用。

参数

func

-

pointer to a function to be called on quick program termination

返回值

​0​如果注册成功,则为非零值。

例外

noexcept规格:

noexcept

注记

这两个重载是不同的,因为参数的类型。func分别为%28语言链接是其类型%29的一部分。

另见

atexit

registers a function to be called on std::exit() invocation (function)

c为at[医]速战速决[医]出口

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券