
Matias Capeletto wrote:
Yes, I have discussed a policy approach with my mentor. In fact, the first implementation of operator[] was to ignore the insertion is something goes wrong. I like the idea of a policy to control this behavior but I have to find a way to maintain the bimap template parameters as simple as they are today. The problem now is to determine if throwing exceptions is the better default behaviour. The policy approach can be implemented as a future feature maintaining backward compatibility.
That all sounds very reasonable. Throwing an exception seems like a good default behavior since pretty much all of the other behaviors can be obtained from that using try/catch or checking for collisions before the insertion. In addition, I know that my own uses of bimaps threw an exception when there were collisions. David