title: I have problems implementing the ++ increment operator
body: <p>I am trying to provide a c++ interface for a c library I just finished, and I want it to be possible to write</p>
  
  <pre><code>for (DBITable table = db.tables() ; table != NULL ; table++)
  </code></pre>
  
  <p>where <code>db</code> is a class with a <code>tables()</code> method that returns the <code>DBITable</code> associated with it.</p>
  
  <p>On compilation I get the following error with <code>clang++</code>
  </p>
  
  <pre class="lang-none prettyprint-override"><code>error: cannot increment value of type 'DBITable'
  for (DBITable table = db.tables() ; table != NULL ; table++)
                                                      ~~~~~^
  </code></pre>
  
  <p>This is how i have implemented the <code>++</code> operator overload method
  </p>
  
  <pre class="lang-c++ prettyprint-override"><code>DBITable
  DBITable::operator++()
  {
      return next();
  }
  </code></pre>
  
  <p>and it's declared in the <code>DBITable</code> class as</p>
  
  <pre class="lang-c++ prettyprint-override"><code>public:
      DBITable operator++();
  </code></pre>
  
  <p>the <code>table != NULL</code> part worked as I expected by doing this </p>
  
  <pre class="lang-c++ prettyprint-override"><code>bool operator!=(void *) 
  {
      // evaluate and get the value
      return value;
  }
  </code></pre>