Brian McNamara <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, Aug 31, 2003 at 12:34:39AM -0700, Mat Marcus wrote: > [snipped] > > So, here's an idea for something completely new which maybe helps fit > your requirements. I start with the motivating example: > > PossUninitVar<Iter> begin, end; > tie( +begin, +end ) = out_edges(v,g); > for( Iter i = ~begin; i != ~end; ++i ) ... > > (Effectively operator~() fetches the value (or asserts if there is none), > whereas operator+() returns a reference to the yet-nonexistent value so > it can be filled in by someone else.) > > My original submission used a proxy operator*() to allow assignment in the same way you do here with operator+(). During the review I removed it because if expressions (*opt) implied possibly undefined behaviour when used a rvalues so should when used as lvalues. Yet assignment is always defined so be changed it by reset(). It didn't ocurred to me though to use _another_ operator instead, and so allow the definitely useful lvalue expressions.
Right now however, I'm inclined toward direct assignment, ala variant, because the only problem with this is the potential conceptual confusion (since this operation is always defined), and I prefer to address this problem at the documentation level. Fernando Cacciola _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost