Subject: Re: [boost] [system] virtual ~error_category
From: Peter Dimov (lists_at_[hidden])
Date: 2018-02-12 20:05:15
Niall Douglas wrote:
> 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
~error_code does not destroy the category, so the virtuality of the
destructor makes no difference. The category will leak in either case.
This is also not quite conforming for another reason; the category is
supposed to be a singleton and two instances should compare equal only when
they are the same object (per the standard).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk