title: avoid returning local references (reference to local variable returned - warning)
body: <p>I have a code snippet that looks as follows. 
  I assume this is a bad way to return a pointer since I am returning a local reference. What is good practice, returning <code>DbTable</code> copy or pointer <code>DbTable *</code>?</p>
  
  <pre><code>  DbTable * Catalog::addTable(PartitionScheme  &amp;partScheme, BoundBases &amp;bounds, std::vector&lt;int&gt; &amp;colsPartitioned, const size_t defaultMaxFragmentSize, const TupleDesc &amp;tupleDesc , std::string tableName){
  
             // some code ...
  
                      DbTable * dbTable = new DbTable(tableId, basePath, defaultMaxFragmentSize, tupleDesc, partScheme, bounds, colsPartitioned); 
                      cout &lt;&lt; "adding dbTable with name: " &lt;&lt; tableName &lt;&lt; " and table Id " &lt;&lt; tableId &lt;&lt; endl;
             // some code ...       
                      return dbTable;
              }
  
      }
  </code></pre>