D is dead
Walter Bright
newshound2 at digitalmars.com
Fri Aug 24 09:46:13 UTC 2018
On 8/23/2018 7:33 PM, Jonathan M Davis wrote:
> Wow. I'm surprised by this. I definitely agree with David on this one.
> Without being able to throw from a constructor, you can't really have it
> fail, and there are times when it needs to be able to fail. Not being able
> to have throwing constructors basically means having to do two-part
> initialization which I would have thought was almost universally considered
> bad.
Not really. You can use a factory function which can do it for you.
> I expect that you'd have a riot on your hands though if you actually tried
> to push for getting rid of throwing constructors.
Maybe not. C++11 tries hard to discourage their use, and we know how hard they
try to not disrupt existing code.
I'd be favorably disposed towards a DIP getting rid of them.
More information about the Digitalmars-d
mailing list