This is throwing a compile-time error: 'class string' has no member named 'first' (or 'second') for every instance of dereferencing the iterator. Below is a fragment of the function that is causing the error. Any ideas?
I believe the site uses Stanford because when I change Map to std::map it throws this error: "Your code is trying to combine two incompatible data types 'map' and 'Map'. conversion from 'map<string, double>' to non-scalar type 'Map<string, double>' requested"
Have you considered range based loops for those two for loops since that is one of the purposes of range based loops is to make iterating over a container easier?
I don't know what a Stanford Map is, or a Map<>::iterator, so I can't help you.
The code looks like it should work with a std::map, but if you want to change it to std::map, you would need to change it everywhere, not just in some places.
And your pastebin link doesn't show full code since there are no headers and no main.
Ok, thanks. There are no main/headers in my pastebin because of the web site I'm using requires you to just enter the function (the URL is in my post above) and it tests your code using the websites backend.
Because in Visual C++ I include the headers, function prototypes, and of course a main(). I also use std::map. The only difference between std::map and Map (in my example anyway) are couple functions (i.e. Map doesn't use at, insert, or insert_or_assign.)
I think this whole issue is related to Stanford's C++ library. Everyone says don't use it if you don't have to. Unfortunately, in this case I think I have to because of that web site I'm using.