can we define a const map , which will take both key and value also to be
something like this...........
const std::map< const unsigned char,const unsigned char> sample_map;
^^^^^ 1 ^^^^^ 2 ^^^^^ 3
There are three const there. The first, just makes the map a constant, i.e.
you can't insert or delete elements etc. This also affects the contained
values, you can only get const references to them.
The second is the key type and even value_type of std::map is already
pair<key_type const, data_type>. I think you can use a constant as
key_type, at least the SGI docs don't mention any restrictions like the
mention on the data_type.
The third type is a const on the data_type, which won't work because those
need to be assignable.
FYI, the (otherwise not relevant) documentation for the STL from SGI's
website explains which types have to fulfil which requirement, you might
want to take a look at them. I guess the docs at the MSDN do the same.
In that case how to we populate it????????
The only const that works and does anything relevant is the first, which
means that you have a const map. You can only populate this via
initialisation, i.e. one of the constructors.
BTW: if you want to solve a real problem, you might want to tell us about
that instead of asking for some cornercase solution.