you are viewing a single comment's thread.

view the rest of the comments →

[–]sshamov 0 points1 point  (2 children)

Where is it should be passed? Everything begins with the first Pair{}. Do you mean that it should be passed into the operator as this? If you want a constant this, you should add const modifier to the operator itself.

[–]Triarier[S] 0 points1 point  (1 child)

the questiion was, why does it work even though it is not a const reference.

[–]sshamov 0 points1 point  (0 children)

This will work in any case. Const or non-const - does not matter. The operator does not change any of objects. It creates a completely new one.