title: From (pointer to a list of pointer to class) to list of classes
body: <p>I have this function where I need to return <code>const std::list&lt;Album&gt;</code> , and what I have is <code>std::list&lt;Album*&gt;*</code>.</p>
  <p>How can I convert the first type to the second type?</p>
  <pre class="lang-cpp prettyprint-override"><code>const std::list&lt;Album&gt; DatabaseAccess::getAlbums()
  {
      char* sqlStatement = &quot;SELECT * FROM Albums;&quot;;
      char* errMessage = nullptr;
  
      std::list&lt;Album*&gt;* data = new std::list&lt;Album*&gt;;
  
      sqlite3_exec(this-&gt;_DataBase, sqlStatement, Album::callback, data, &amp;errMessage);
  
      return  ; // ?
  }
  </code></pre>
  <p>EDIT:</p>
  <p>Will this work?</p>
  <pre class="lang-cpp prettyprint-override"><code>std::list&lt;Album&gt; casted_list;
  
  for (auto i = data-&gt;begin(); i != data-&gt;end(); i++)
  {
      casted_list.push_back(*(*i));
  }
  </code></pre>