Here you are:
void theFunction()
{
static std::unique_ptr<int> foo { new int(42) };
}
struct Creator
{
Creator() { theFunction(); }
};
struct Destroyer
{
~Destroyer() { theFunction(); }
};
Destroyer d;
Creator c;
int main()
{}
d , . c, theFunction(), - foo.
. , foo , c. , d , theFunction(), foo .
, , undefined.