Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2006-02-07 00:00:56


Giovanni P. Deretta wrote:
> Stefan Seefeld wrote:
>
>>Giovanni P. Deretta wrote:
>>
>>
>>
>>>You could argue that as this is a useful behavior stream_socket should
>>>have pointer semantics by default and be reference counted. But you
>>>would force the space and time overhead of a shared_ptr to everybody
>>>(btw, shared_ptr still require dynamic allocation of the reference
>>>counter).
>>
>>
>>If users would always only hold references to the real resource, how
>>would they declare interest in a 'ready-for-read' event, and which of
>>the references would receive it ?
>>
>
>
> I do not understand exactly what you are asking? Could you eleaborate?

As far as I understand the above suggestion, sockets (streams) having
reference semantics (or be copyable) implies that multiple objects
exist that refer to the same underlaying 'device'.

If the system has data ready to be read for that device, which reference
should it dispatch them to ?

Thanks,
                Stefan


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