I recently looked at my old code and I can't figure out what this does, or whether it is valid. The code is something like:
map<string, string> map;
map[string1] = ("s", string2);
It's an obfuscation. The comma operator evaluates all the arguments from left to right but discards all arguments apart from the final one. The formal type of the entire expression is the type of the final argument.
(Note also that the comma itself is a sequencing point.)
string2 becomes the value in the map, under key string1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With