Boost logo

Boost :

Subject: Re: [boost] asio library
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-10-27 12:52:27


Peter Foelsche wrote:
> "Olaf van der Spek" <olafvdspek_at_[hidden]> wrote in message
> news:b2cc26e40910270119o6d461aa6x29607f0362eac6e0_at_mail.gmail.com...
>
> >> What is the use of the socket object created in the first line?
> >
> > Doesn't the third line use it?
>
> The point is that there must be always something following
> this statement --
> by itself it does not make any sense. Thus this code could have been
> combined with any possible following code.

Two-stage construction is a common, if somewhat awkward idiom. I can imagine -- but don't know -- that this was done to give the option of not getting exceptions when they aren't wanted, though I know you find that disturbing.

Perhaps the constructor can be overloaded to allow both approaches?

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk