No matching function call to class member
<p>I have implemented a generic list and I am trying to retrieve the data from a certain position in the list. umm... but I am getting an error: no matching function for call to 'List::retrieve(int&amp;, Record&amp;)'
Below is the code of main.cpp and a snippet of function retrieve from List.h.#include </p>

<p><strong>Main.cpp</strong></p>

<pre><code>#include &lt;iostream&gt;
#include "List.h"    
#include "Key.h"
using namespace std;
typedef Key Record;
int main()
{
    int n;
    int p=3;
    List&lt;int&gt; the_list;
    Record data;
    cout&lt;&lt;"Enter the number of records to be stored. "&lt;&lt;endl;
    cin&gt;&gt;n;
    for(int i=0;i&lt;n;i=i++)
    {
    the_list.insert(i,i);
    }
    cout&lt;&lt;the_list.size();
    the_list.retrieve(p, data);
    cout&lt;&lt;"Record value: "&lt;&lt;data;
    return 0;
}
</code></pre>

<p><strong>List.h</strong></p>

<pre><code>Error_code retrieve(int position, List_entry &amp;x)const
    {
    if(empty()) return underflow;
    if(position&lt;0 || position&gt;count) return range_error;
    x=entry[position];
    return success;
    }
</code></pre>

<p>For full code:</p>

<p>Main.cpp: <a href="http://pastebin.com/UrBPzPvi" rel="nofollow">http://pastebin.com/UrBPzPvi</a></p>

<p>List.h: <a href="http://pastebin.com/7tcbSuQu" rel="nofollow">http://pastebin.com/7tcbSuQu</a></p>

<p>P.S I am just learning the basics and the code may not be perfect with regards to large scale reusable module. At this stage, it just needs to work.</p>

<p>Thanks</p>
