C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Catch exception thrown from constructor of global object

From: Bo Persson <bo_at_[hidden]>
Date: Thu, 12 Jan 2023 15:46:41 +0100
On 2023-01-12 at 11:23, Frederick Virchanza Gotham via Std-Proposals wrote:

>
> Now if you were to ask me . . . . I would almost go so far as to
> propose that C++26 should deprecate defining a global object that
> doesn't satisfy 'is_trivial' so that all such objects would be wrapped
> in an std::optional<T> and emplaced within the body of 'main', but of
> course I know that I won't get any support on that.

True that.

Banning things like std::cin and std::cout wouldn't get much support.

Received on 2023-01-12 14:46:48