I want to make structure storing value with two keys - 'x' and 'y'. I thought i will use std::map>. But I think it would be better to use just one std::map and combine both keys into one key (I will call it 'p').
So I need function p->(x,y) and function (x,y)->p. Both 'x' and 'y' are integer types with negative values allowed.
I think that it should be possible but I am surprised that I did not find tons of articles about it on the internet.
I have some ideas about how to do it, but all seems too complicated. Could you please give me some advices about how to do it or what topics to read about this problematics?
Example of possible mapping (but I need mathematical form of something like that): https://i.stack.imgur.com/UbVaM.png
Thank you for any advices :-)