Re:C++ pitfalls
by idupree on Wednesday November 28, 2012 @02:08PM
(#4844105)
You could return a proxy object that offers operator= et al, and an implicit conversion operator to T& or T const& that throws an exception if that key is not in the map.
(I don't know if that would be better, since it's even more magic and it still isn't perfect.)
(I don't know if that would be better, since it's even more magic and it still isn't perfect.)