William Kempf wrote: >> Some people, mostly _me_, argued that this is not a good idea >> because code would change meaning if optional<> is replaced >> by a pointer. > >But it's going to change in any event, because optional<> _isn't_ a pointer. > >But in generic code you must follow the semantics of the concept, >and optional<> isn't useable when a SmartPointer concept is >required. Define the concept well enough, and optional<> becomes >useful in generic code.
Hi Will, I really appreciate the comments you've been making on this topic, so I wanted to ask for a couple more :) 1) Fernando and I briefly went over defining an OptionalValue concept, of which real pointers, smart pointers, and optional would model (along with others, I'm sure). Is this on the right track to define the concept "well enough?" 2) Presuming three things: a) Pointer interface is kept b) OptionalValue concept is well defined c) deep comparison is kept would you be at all concerned about optional compiling when misused in generic code that presumes different semantics for the comparison operator? This feels like a booby-trap to me, but I would like to know your and other people's opinions on this specific point. Thanks- Augustus __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost