You program seems to work fine in terms of printing out the elements of the container 'grades' but what you probably want to do is to search for a name in 'names' and print out the grades of this name (if present) in grades:
well, if you don't show your program how can anyone tell what's on line 17?
as mentioned above, the OP might be poorly written but it compiles and runs: http://coliru.stacked-crooked.com/a/ffe35526e27238f1
so the following statement is not correct:
but for some reason I am getting no operator matches these operands "<<" on line 17.
My first suggestion is to change the name of the "iterator" in your ranged based loop to something other than pair, there is a std::class with that name and since you're using the "using" statement you'd be best to avoid name conflicts.
Second what exactly is your error message?
Are you positive that your compiler is using the C++11 or higher standard?
I get this output with the program following (compiled using the C++14 standard):
Assuming that is the only warning or error the next step would be to find what part of that cout statement is the problem. You do this by placing each statement on it's own line.