Destructors for C++ Interface-like classes
<p>Starting to use PC-Lint on an existing code base (fear and trepidation).</p>

<p>One thing that it complains about is the following:</p>

<pre><code> class IBatch
 {
 public:
    virtual void StartBatch() =0;
    virtual int CommitBatch() =0;
 };
</code></pre>

<p>Which when another class derives from this to use it like an interface </p>

<pre><code>base class 'IBatch' has no destructor
</code></pre>

<p>So, the question: when you create <em>Interface</em> classes like the above, do you always include a virtual destructor?  Why? (is it a style or a coding error?)</p>

<p>EDIT: Should have said that I do not expect or want the <em>user</em> of IBatch to destruct, they are a consumer of a service only, through this interface to some external implementing class (if that would make a difference)</p>
