Note that there are some explanatory texts on larger screens.

plurals
  1. POno constructor could take the source type
    primarykey
    data
    text
    <p>I keep getting the error no constructor could take the source type, or constructor overload resolution.</p> <p>At the beginning of my code i have declared an unordered map.</p> <pre><code>unordered_map&lt;char * , a_dictionary * &gt; Mymap; unsigned char hash[20]; char hex_str[41]; string answer, line; int yes=0; cout&lt;&lt;"Press 1 if you would like to use the default file(d8.txt) or press 2 if you want your own file"&lt;&lt;endl; getline(cin,answer); stringstream(answer)&gt;&gt; yes; if(yes == 1 ) { ifstream myfile("d8.txt"); if (myfile.is_open()) { while ( myfile.good() ) { getline (myfile,line); //cout&lt;&lt;line&lt;&lt;endl; a_dictionary * dic = new dictionary(); dic-&gt;word = line; const char * c= line.c_str(); sha1::calc(c,line.length(), hash); sha1::toHexString(hash,hex_str); Mymap.insert(hex_str, dic); // </code></pre> <p>THis line right here "mymap.insert" keeps giving me the error error C2664: 'std::_List_iterator&lt;_Mylist> std::_Hash&lt;_Traits>::insert(std::_List_const_iterator&lt;_Mylist>,_Valty) even though im passing the right values right?</p> <p>here is the function that call toHeXString</p> <pre><code>void toHexString(const unsigned char* hash, char* hexstring) { const char hexDigits[] = { "0123456789abcdef" }; for (int hashByte = 20; --hashByte &gt;= 0;) { hexstring[hashByte &lt;&lt; 1] = hexDigits[(hash[hashByte] &gt;&gt; 4) &amp; 0xf]; hexstring[(hashByte &lt;&lt; 1) + 1] = hexDigits[hash[hashByte] &amp; 0xf]; } hexstring[40] = 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload