[Bug libstdc++/84056] map insertes a pair when check a value

2018-01-26 Thread alper.ccc at yandex dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84056 --- Comment #5 from Alper Ce --- (In reply to Marc Glisse from comment #4) > (In reply to Alper Ce from comment #3) > > I didn't assign anything to my_map(i didn't use assignment operator = ), i > > just used == operator to check value of it. >

[Bug libstdc++/84056] map insertes a pair when check a value

2018-01-26 Thread alper.ccc at yandex dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84056 --- Comment #3 from Alper Ce --- (In reply to Marc Glisse from comment #2) > Where is the bug? Did you read the documentation for operator[]? I didn't assign anything to my_map(i didn't use assignment operator = ), i just used == operator to

[Bug c++/84056] map insertes a pair when check a value

2018-01-25 Thread alper.ccc at yandex dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84056 --- Comment #1 from Alper Ce --- output: a => 1 b => 2 Map after if condition(a new pair ['c':0] inserted in map!): a => 1 b => 2 c => 0

[Bug c++/84056] New: map insertes a pair when check a value

2018-01-25 Thread alper.ccc at yandex dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: alper.ccc at yandex dot com Target Milestone: --- In this example there is a map with 2 pairs ( a:1 and b:2) but after checking the unavailable vale in if statement (value of c) it inserts new pair (c:0) to the map: #include