std::map does not automatically deduct types in C++17 #28
omair-khalid
started this conversation in
General
Replies: 2 comments 9 replies
-
Hi @omair-khalid, it is working fine for me. Can you please mention how you are compiling it? |
Beta Was this translation helpful? Give feedback.
4 replies
-
Hey @omair-khalid, sorry for a late response. For whatever reason, I was not notified of this discussion. Could you also provide some info about the system you're using? Also what does the |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I compile the example code for std::map, the following line gives an error:
std::map mutable_map = {std::pair{42, 42.42}, std::pair{23, 23.23}};
The error is:
I am compiling using c++17, but there still is this error. It gets resolved only when I specify the template types of std::map i.e.
std::map<int, float> mutable_map = {std::pair{42, 42.42}, std::pair{23, 23.23}};
Any idea why this is happening to me?
Beta Was this translation helpful? Give feedback.
All reactions