Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-12-16 17:50:11


Augustus Saunders <infinite_8_monkey_at_[hidden]> writes:

> William Kempf wrote:
>>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.

I'm with Bill.

> 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?"

Sounds right to me, FWIW.

> 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,

I'm not in the least worried.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk