From: Alexander Nasonov (alnsn-mycop_at_[hidden])
Date: 2003-10-01 06:28:25
I think it's possible to detect classes that have dtor with throw() spec.
The trick is based on a fact that implicitly declared dtor inherits
throw-spec from its bases and a fact that virtual dtor overrided in a
derived class can't have less restrictive throw-spec.
In this example, tester<T> can only be instantiated if T's dtor looks like
T::~T() throw(); otherwise, a compiler will complain. SFINAE can be applied
to get rid of compile error.
virtual ~virtual_nothrow_dtor() throw();
struct tester : T, virtual_nothrow_dtor
// Implicitly defined dtor
-- Alexander Nasonov Remove minus and all between minus and at from my e-mail for timely response
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk