Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

During normal program termination, any registered callbacks using std::atexit are executed as part of the cleanup. The callbacks follow the initialization and destruction rules from C++11. For example, if a construction of a static object was ordered before a callback is registered, the destruction of that object will be sequenced after the callback is invoked. Compiler Explorer link: https://lnkd.in/eihDRvg6 #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text
Abhay Kumar

Synechron775 followers

2y

What's the actual use of this? Cleanup is being carried out at the time of destructor call . If we need any cleanup before destructor call then we can write a simple method and do cleanup in that .

Like
Reply
Chris Ryan

ISO/IEC JTC1/SC22/WG21 - The…11K followers

2y

Tidbit: automatic object destruction is in reverse order of construction.

Vikram Lodhi

Undisclosed863 followers

2y

when C++ is going to implement defer.... I really like Zig defer implementation and Enum Union

Like
Reply
Dean Turpin

Zenitel2K followers

2y

Well I never! 👍🏻

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories