Boost logo

Boost :

Subject: Re: [boost] [system] virtual ~error_category
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2018-02-12 19:50:15


> But as far as Boost.System goes, I think de-virtualising its destructor
> is a major API break. I can see plenty of code out there in the wild
> relying on that destructor firing when it's supposed to, and Boost
> devirtualising it would equal a resource leak where there was none
> before. That's as big as break as changing what `if(ec)` means (which
> BTW is currently being deleted in `status_code` to force people to write
> what they actually mean).

It also occurs to me now that Charley mentioned to me once that some
people instantiate custom categories carrying payload and hand them out
one per error_code instance. It's a way of attaching payload to
error_code. That use case definitely requires a virtual destructor to
work right.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/

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