Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-05-02 19:41:31


"Greg Colvin" <greg_at_[hidden]> wrote in message
news:5.1.0.14.0.20020502151136.02af8e00_at_GMMAIL...
> And, referring back to a point you made about HANDLE causing
> shared_ptr<HANDLE> to different things (like files and windows)
> to be assignable, I think the real problem is that Win32 uses
> a void* handle to point to all kinds if things, and has many
> functions that work on generic HANDLEs, as well as many functions
> that work only on specific HANDLEs. It's a mess to untangle,
> but can be done with a wrapper class for the generic HANDLE and
> derived classes for more specific HANDLEs.

Inheritance doesn't model things properly here. The different types of
handles in Windows are unrelated and do not sport much commonality and
little variation. Consequently, a hierarchy is not useful here.

Different types of handles should map to different, distinct types.

> Then we can negotiate shared_ptr's assimilation.

As I wrote in my post "Adding Loki to Boost: reprise", I believe that it's
best I don't put myself in a negotiator's position.

Andrei


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