Re: Subclass TcpSocket?

2025-03-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 18, 2025 1:19:49 PM MDT bauss via Digitalmars-d-learn wrote: > On Tuesday, 18 March 2025 at 18:04:12 UTC, Steven Schveighoffer > wrote: > > On Tuesday, 18 March 2025 at 07:42:37 UTC, Jonathan M Davis > > wrote: > >> The base class constructors are not nothrow, so WrappedTCP's > >>

Re: Subclass TcpSocket?

2025-03-18 Thread bauss via Digitalmars-d-learn
On Tuesday, 18 March 2025 at 18:04:12 UTC, Steven Schveighoffer wrote: On Tuesday, 18 March 2025 at 07:42:37 UTC, Jonathan M Davis wrote: The base class constructors are not nothrow, so WrappedTCP's constructor cannot be nothrow. There really isn't a way out of that, because if a constructor th

Re: Subclass TcpSocket?

2025-03-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On Tuesday, 18 March 2025 at 07:42:37 UTC, Jonathan M Davis wrote: The base class constructors are not nothrow, so WrappedTCP's constructor cannot be nothrow. There really isn't a way out of that, because if a constructor throws, the object's state is destroyed. So, catching and handling the Ex

Re: Subclass TcpSocket?

2025-03-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, March 17, 2025 4:14:21 PM MDT Andy Valencia via Digitalmars-d-learn wrote: > The presence of the "accepting" API in Socket seems to indicate > that subclassing Socket/TcpSocket is intended to be supported. > But I'm just not seeing my way through the twisty maze of pure > and @nothrow b

Re: Subclass TcpSocket?

2025-03-18 Thread Enamisu via Digitalmars-d-learn
On Monday, 17 March 2025 at 22:14:21 UTC, Andy Valencia wrote: The presence of the "accepting" API in Socket seems to indicate that subclassing Socket/TcpSocket is intended to be supported. But I'm just not seeing my way through the twisty maze of pure and @nothrow barriers? [...] It seems