If std::exit is called to
end a program during the destruction of an object with static or thread storage duration, the program has
undefined behavior.
[Example 1: #include<cstdlib>struct Exiter {~Exiter(){ std::exit(0); }};
Exiter ex;
int main(){}// undefined behavior when destructor of static variable ex is called it will call std::exit — end example]