Compiler error C2664 and xmemory0
<p>I'm trying to pinpoint where the location of this error is coming from. C2664 is a parameter conversion problem that isn't showing up as an error in my coding, but rather something that is written in xmemory0 (or at least, that's how i'm interpreting it). I understand that part of what it's complaining about is that it is being asked to convert from an allocator to a string. I'm not using an allocator in this file.</p>

<p><strong>The error reads:</strong> </p>

<pre><code>C2664   'std::pair&lt;const _Kty,_Ty&gt;::pair(std::pair&lt;const _Kty,_Ty&gt;      
&amp;&amp;)': cannot convert argument 1 from       
'std::vector&lt;std::string,std::allocator&lt;_Ty&gt;&gt;' to 'const std::string &amp;'  
Project1    c:\program files (x86)\microsoft visual studio 
14.0\vc\include\xmemory0, Line 737
</code></pre>

<p><strong>The code in question:</strong></p>

<pre><code>/* 
Interpreter class implementation: utilizes the lex scanner class as
well as the expression evaluator to interpret simple statements like 
read display and assignment statements

!!: indicates current problems or things that are going to be problems.
*/

#include &lt;iostream&gt;
#include &lt;map&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;cstdlib&gt;
#include "lexScanner.h"
#include "expEvaluator.h"
#include "interpreter.h"
using namespace std;


void Interpreter::executeProgram(vector&lt;string&gt;&amp; sourceProgram)
{
    // ****************************************************
    // PARSING THE INFORMATION:
    // Intialize all containers for storage of broken down string components
    // Resize al appropriate vectors to the size of the source program
    // ****************************************************

    // !!: This probably wont work. Source program is going to be magnitudes 
    // smaller than the amount of category tokens
    // but it worked in the last programming project soooo. .. .


    vectOfTokenVects myVectOfTokenVects;
    vectOfCategoryVects myVectOfCategoryVects;
    perLineCategoryVector myPerLineCatVect;


    // Send for parsing
    LexicalScanner::getLexicalInfo(sourceProgram,myVectOfTokenVects,myVectOfCategoryVects);


    //Display the lexical information for user's means

    cout &lt;&lt; "Here is a preview of the source code to be executed. . \n";

    // Create a string-to-float map that serves as a symbol table to maintain
    // the names of variables and their values during execution

    // !!: figure out how to store items in the map
    floatVarValueTable varTable;

    // ****************************************************
    // EXECUTING A READ STATEMENT: 
    // Obtain numerical input from the user and 
    // store it properly in the corresponding variable in the map as a symbol
    // table.
    // ****************************************************

    // Cycle through the tokens, searching for the three categories

    // If the catToken is keyword AND IS read, go ahead and execute a cin 
    // If the catToken is keyword AND IS display, go ahead and execute a cout 

    // If the catToken is an assignment statement, figure out how far the 
    // math expression goes. Try to compute the line. Search comma to comma?
    // ****************************************************
    for (int i = 0; i &lt; myVectOfCategoryVects.size(); i++)
    {
        // Start out with the largest net: search for keywords
        for (int j = 0; j &lt; myVectOfCategoryVects[i].size(); j++)
        {
            if (myVectOfCategoryVects[i][j] == KEYWORD)
            {

                // SCENARIO 1: READ STATEMENT
                // Have the user enter the value for the variable to be added to vartable.
                if ((myVectOfTokenVects[i][j] == "Read") || (myVectOfTokenVects[i][j] == "READ") || (myVectOfTokenVects[i][j] == "read"))
                {
                    float reportedValue;
                    cout &lt;&lt; "Please enter a value for: " &lt;&lt; myVectOfTokenVects[i][j + 1] &lt;&lt; endl;
                    cin &gt;&gt; reportedValue;
                    string dumpedString = myVectOfTokenVects[i][j + 1];
                    varTable.emplace(dumpedString, reportedValue);
                }


                // SCENARIO 2: DISPLAY STATEMENT
                // Search the vector (token vector) for things to display. 
                if (myVectOfTokenVects[i][j] == "Display" || myVectOfTokenVects[i][j] == "display" || myVectOfTokenVects[i][j] == "DISPLAY")
                {
                    // Search the vector continiously until you reach a comma or semicolon. Both comma and semicolon indicate the end of the display statement.
                    int currentPosition = j+1;

                    for (int j = currentPosition; j &gt; myVectOfTokenVects[i].size(); i++)
                    {
                        if (myVectOfCategoryVects[i][j] != COMMA)
                        {
                            cout &lt;&lt; myVectOfTokenVects[i][j];
                        }
                        // We've got something after the comma, prob an expression. Send it to expression evaluator
                        if (myVectOfCategoryVects[i][j] == COMMA)
                        {
                            expVector infixExpression;
                            float expValue;
                            // Start filling up the expression vector
                            for (int k = j; k &gt; myVectOfTokenVects[i][j].size(); k++)
                            {
                                infixExpression.push_back(myVectOfTokenVects[i][k]);

                            }
                            // Take the newly formed expression vector and send it to the evaluator. It does pass by reference, so the values in the vartable and infixexpression are going to be updated
                            ExpressionEvaluator::infixEvaluator(infixExpression, varTable, expValue);
                            cout &lt;&lt; expValue;
                        }
                    }

                }
            }

            // ****************************************************
            // SEARCHING FOR VARIABLES
            // If the token in question is an assignment operator, go ahead
            // and insert the item before and after it.

            // Note: This leaves a hole stating that if there is a floating
            // equals sign somewhere with nothing before or after it, it
            // could cause a out of bounds error.

            // Note: We should also check for the presence of an equation.
            // Evaluate the RHS of the assignment op

            if (myVectOfCategoryVects[i][j] == ASSIGNMENT_OP)
            {
                // SCENARIO 1: SIMPLE EVALUATION
                // If it's a simple 3 part assignment statement: ie:
                // name (=) value, go ahead and store it
                if (myVectOfCategoryVects[i][j + 2])
                {
                    // Make sure the assignment op has a var name
                    if (myVectOfCategoryVects[i][j - 1])
                    {
                        // Store both the name and value
                        varTable.emplace(myVectOfTokenVects[j - 1], myVectOfTokenVects[j + 1]);
                    }
                }
            }

            // SCENARIO 2: COMPLEX EVALUATION
            // More complex evaluation: sending the RHS to the evaluator
            // NOTE: postfix evaluator needs to be fixed. .
            if (myVectOfCategoryVects[i][j] == ASSIGNMENT_OP)
            {
                // Semicolon out of normal place, assume incoming expression
                if (myVectOfCategoryVects[i][j + 2] != SEMICOLON)
                {
                    // NOTE: The placement of this is intentional. . .it guarentees that they get cleared on OOS
                    expVector infixExpression;
                    float expValue;

                    // Start with whatever is before the assignment op, start adding items to the infixExpression vector. Lookout for semicolon
                    for (int j = 0; myVectOfCategoryVects[i][j] != SEMICOLON; i++)
                    {
                        infixExpression.push_back(myVectOfTokenVects[i][j]);
                    }
                    // Take the newly formed expression vector and send it to the evaluator. It does pass by reference, so the values in the vartable and infixexpression are going to be updated
                    ExpressionEvaluator::infixEvaluator(infixExpression, varTable, expValue);
                }
            }
        }
    }
}
</code></pre>

<p><strong>Relative definitions:</strong></p>

<pre><code>//****************************************************************************
// define a mnemonic name for the type to store tokens of one line of statement
//****************************************************************************
typedef vector&lt;string&gt; perLineTokenVector;


//****************************************************************************
// define a mnemonic name for the type to store tokens of lines of statement
//****************************************************************************
typedef vector&lt;perLineTokenVector&gt; vectOfTokenVects;


//****************************************************************************
// define a mnemonic name for the type to store categories of tokens 
// of one line of statement
//****************************************************************************
typedef vector&lt;tokenCategory&gt; perLineCategoryVector;


//****************************************************************************
// define a mnemonic name for the type to store categories of tokens 
// of one line of statement
//****************************************************************************
typedef vector&lt;perLineCategoryVector&gt; vectOfCategoryVects;
</code></pre>

<p><strong>edit: The error seems to reside in this area</strong></p>

<pre><code>if (myVectOfCategoryVects[i][j] == ASSIGNMENT_OP)
            {
                // SCENARIO 1: SIMPLE EVALUATION
                // If it's a simple 3 part assignment statement: ie:
                // name (=) value, go ahead and store it
                if (myVectOfCategoryVects[i][j + 2]=SEMICOLON)
                {
                    // Make sure the assignment op has a var name
                    if (myVectOfCategoryVects[i][j - 1] = STRING_LITERAL)
                    {
                        string stringDump = myVectOfTokenVects[i][j - 1];

                        // Store both the name and value
                        varTable.emplace(stringDump, myVectOfTokenVects[i][j + 1]);
                    }
                }
            }
</code></pre>

<p><strong>Build output</strong></p>

<pre><code>1&gt;------ Build started: Project: Project1, Configuration: Debug Win32 ------
1&gt;  interpreter.cpp
1&gt;c:\users\alfar\google drive\school\programminglanguages\programming 4a\programming 4a vs2\project1\project1\interpreter.cpp(67): warning C4018: '&lt;': signed/unsigned mismatch
1&gt;c:\users\alfar\google drive\school\programminglanguages\programming 4a\programming 4a vs2\project1\project1\interpreter.cpp(70): warning C4018: '&lt;': signed/unsigned mismatch
1&gt;c:\users\alfar\google drive\school\programminglanguages\programming 4a\programming 4a vs2\project1\project1\interpreter.cpp(94): warning C4018: '&gt;': signed/unsigned mismatch
1&gt;c:\users\alfar\google drive\school\programminglanguages\programming 4a\programming 4a vs2\project1\project1\interpreter.cpp(106): warning C4018: '&gt;': signed/unsigned mismatch
1&gt;c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(737): error C2664: 'std::pair&lt;const _Kty,_Ty&gt;::pair(std::pair&lt;const _Kty,_Ty&gt; &amp;&amp;)': cannot convert argument 2 from 'std::string' to 'const float &amp;'
1&gt;          with
1&gt;          [
1&gt;              _Kty=std::string,
1&gt;              _Ty=float
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(737): note: Reason: cannot convert from 'std::string' to 'const float'
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(737): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(857): note: see reference to function template instantiation 'void std::allocator&lt;_Other&gt;::construct&lt;_Objty,std::string&amp;,std::string&amp;&gt;(_Objty *,std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Other=std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;,
1&gt;              _Objty=std::pair&lt;const std::string,float&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(857): note: see reference to function template instantiation 'void std::allocator&lt;_Other&gt;::construct&lt;_Objty,std::string&amp;,std::string&amp;&gt;(_Objty *,std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Other=std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;,
1&gt;              _Objty=std::pair&lt;const std::string,float&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(996): note: see reference to function template instantiation 'void std::allocator_traits&lt;_Alloc&gt;::construct&lt;_Ty,std::string&amp;,std::string&amp;&gt;(std::allocator&lt;_Other&gt; &amp;,_Objty *,std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Alloc=std::allocator&lt;std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;&gt;,
1&gt;              _Ty=std::pair&lt;const std::string,float&gt;,
1&gt;              _Other=std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;,
1&gt;              _Objty=std::pair&lt;const std::string,float&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(995): note: see reference to function template instantiation 'void std::allocator_traits&lt;_Alloc&gt;::construct&lt;_Ty,std::string&amp;,std::string&amp;&gt;(std::allocator&lt;_Other&gt; &amp;,_Objty *,std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Alloc=std::allocator&lt;std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;&gt;,
1&gt;              _Ty=std::pair&lt;const std::string,float&gt;,
1&gt;              _Other=std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;,
1&gt;              _Objty=std::pair&lt;const std::string,float&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtree(889): note: see reference to function template instantiation 'void std::_Wrap_alloc&lt;std::allocator&lt;_Other&gt;&gt;::construct&lt;_Ty,std::string&amp;,std::string&amp;&gt;(_Ty *,std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Other=std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;,
1&gt;              _Ty=std::pair&lt;const std::string,float&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtree(887): note: see reference to function template instantiation 'void std::_Wrap_alloc&lt;std::allocator&lt;_Other&gt;&gt;::construct&lt;_Ty,std::string&amp;,std::string&amp;&gt;(_Ty *,std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Other=std::_Tree_node&lt;std::pair&lt;const std::string,float&gt;,void *&gt;,
1&gt;              _Ty=std::pair&lt;const std::string,float&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtree(1076): note: see reference to function template instantiation 'std::_Tree_node&lt;std::pair&lt;const _Kty,_Ty&gt;,void *&gt; *std::_Tree_comp_alloc&lt;_Traits&gt;::_Buynode&lt;std::string&amp;,std::string&amp;&gt;(std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Kty=std::string,
1&gt;              _Ty=float,
1&gt;              _Traits=std::_Tmap_traits&lt;std::string,float,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;const std::string,float&gt;&gt;,false&gt;
1&gt;          ]
1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtree(1076): note: see reference to function template instantiation 'std::_Tree_node&lt;std::pair&lt;const _Kty,_Ty&gt;,void *&gt; *std::_Tree_comp_alloc&lt;_Traits&gt;::_Buynode&lt;std::string&amp;,std::string&amp;&gt;(std::string &amp;,std::string &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Kty=std::string,
1&gt;              _Ty=float,
1&gt;              _Traits=std::_Tmap_traits&lt;std::string,float,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;const std::string,float&gt;&gt;,false&gt;
1&gt;          ]
1&gt;  c:\users\alfar\google drive\school\programminglanguages\programming 4a\programming 4a vs2\project1\project1\interpreter.cpp(145): note: see reference to function template instantiation 'std::pair&lt;std::_Tree_iterator&lt;std::_Tree_val&lt;std::_Tree_simple_types&lt;std::pair&lt;const _Kty,_Ty&gt;&gt;&gt;&gt;,bool&gt; std::_Tree&lt;std::_Tmap_traits&lt;_Kty,_Ty,_Pr,_Alloc,false&gt;&gt;::emplace&lt;std::string&amp;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;&amp;&gt;(std::string &amp;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt; &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Kty=std::string,
1&gt;              _Ty=float,
1&gt;              _Pr=std::less&lt;std::string&gt;,
1&gt;              _Alloc=std::allocator&lt;std::pair&lt;const std::string,float&gt;&gt;
1&gt;          ]
1&gt;  c:\users\alfar\google drive\school\programminglanguages\programming 4a\programming 4a vs2\project1\project1\interpreter.cpp(145): note: see reference to function template instantiation 'std::pair&lt;std::_Tree_iterator&lt;std::_Tree_val&lt;std::_Tree_simple_types&lt;std::pair&lt;const _Kty,_Ty&gt;&gt;&gt;&gt;,bool&gt; std::_Tree&lt;std::_Tmap_traits&lt;_Kty,_Ty,_Pr,_Alloc,false&gt;&gt;::emplace&lt;std::string&amp;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;&amp;&gt;(std::string &amp;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt; &amp;)' being compiled
1&gt;          with
1&gt;          [
1&gt;              _Kty=std::string,
1&gt;              _Ty=float,
1&gt;              _Pr=std::less&lt;std::string&gt;,
1&gt;              _Alloc=std::allocator&lt;std::pair&lt;const std::string,float&gt;&gt;
1&gt;          ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</code></pre>

<p><strong>edit 3</strong>
It appears that the problem was with what I was passing to the emplacement function for the map. <code>myVectOfTokenVects</code> is a fancy string vector of string vectors. The second argument to the <code>map.emplacement()</code> requires a float value, of which <code>myVectOfTokenVects</code> cannot supply. The problem has been found. </p>

<p><strong>Follow-up:</strong>
How would I go about parsing the string value to cast it to a float for <code>map.emplacement()</code>?</p>