Boost logo

Boost :

Subject: Re: [boost] Should pass boost::asio::io_service by raw pointer or smart pointer?
From: Richard Hodges (hodges.r_at_[hidden])
Date: 2018-12-21 10:18:44

reposting to group as previous message was sent direct.

On Fri, 21 Dec 2018 at 15:32, hh h <jupiter.hce_at_[hidden]> wrote:

> Thanks Vinnie, that blog and author were also referenced by a boost
> asio book, wandering how much could be quickly outdated by books and
> online commentate, this mailing list is the truly one for updated
> clarification.

There are three good places that spring to mind:

* Here
* StackOverflow
* CppCon videos (search on youtube).

I don't think there's any need to buy a book on anything technical these
days. It would be out of date before it were published.

*Absolutely ignore all blogs.*

They are not subject to anywhere near the same degree of meticulous
scrutiny and unforgiving peer review as the StackOverflow c++ channel.

If you post a wrong answer there, the people who actually know their stuff
will come in for the kill within minutes.

This is good for people who are looking to learn, as it means that bad
information and worthless opinion is erased before it can do much damage.

> Thank you and very much appreciated.
> - JHH
> On 12/21/18, Vinnie Falco <vinnie.falco_at_[hidden]> wrote:
> > On Thu, Dec 20, 2018 at 8:37 PM hh h <jupiter.hce_at_[hidden]> wrote:
> >> It looks like a very good tutorial, but it used all shared pointer for
> >> io_services, deadline_timer, socket, io_service::strand,
> >> io_service::work and applications which contradicted to your comments,
> >> was it wrong or outdated or did I misinterpreted your following point?
> >
> > It is both wrong, and outdated. Modern asio's executor_work_guard has
> > a member function reset() which releases the work. Probably the
> > shared_ptr in the examples used to manage the guard were written
> > before the reset() member was added. But there are other constructs in
> > that tutorial which are outdated.
> >
> > I would look to the latest Asio examples and documentation for best
> > practices. And if you have specific questions don't hesitate to ask on
> > the list or open an issue in the relevant repository.
> >
> > Regards
> >

Richard Hodges
office: +442032898513
home: +376841522
mobile: +376380212 (this will be *expensive* outside Andorra!)
skype: madmongo
facebook: hodges.r

Boost list run by bdawes at, gregod at, cpdaniel at, john at