I meant that it's wonderful to use RAII classes that others have developed, rather than implement RAII classes for others to use. But now that you mention it:
>It's about writing the constructor in such a way that you can always safely destroy the object.
I agree, but I see this as a good thing, even though it makes the class slightly harder to implement than it might be if responsibility for getting the object into a state safe for destruction is dumped on (or even shared with) the calling code. The latter approach requires programmer discipline at every use -- but you will only implement the class once, and probably use it many times.
>It's about writing the constructor in such a way that you can always safely destroy the object.
I agree, but I see this as a good thing, even though it makes the class slightly harder to implement than it might be if responsibility for getting the object into a state safe for destruction is dumped on (or even shared with) the calling code. The latter approach requires programmer discipline at every use -- but you will only implement the class once, and probably use it many times.