Actually I'm quite sure I've missed something trivial here, but I just can't find it.
Seemingly I cannot read from a const map&
I try
If I remove the troubling const I'm able to access it but I don'r really feel like giving up on const
I'm thankful for any hint
J
Seemingly I cannot read from a const map&
I try
Code:
#include <iostream>
#include <map>
using namespace std;
void show (
const // troubling-const
map<char, double>& myconstmap )
{
cout << "A->" << myconstmap['A'] << "\n";
}
int main ()
{
map<char, double> mymap;
mymap['A']=0.1;
}
I'm thankful for any hint
J
Comment