
On 2/7/06, Giovanni P. Deretta <gpderetta@gmail.com> wrote: [snip]
Now we agree :) Yes, it is useful behaviour and probably should be supported directly by asio. But it should not be the default or at least the user should have the option.
Perfect!
Along side the current non-copyable (but maybe movable) stream_socket asio could provide a stream_socket_ptr that would behave as if it were a shared_ptr to a stream_socket (that is, pointer semantics), but it wouldn't actually allocate a stream_socket (similar to the way an optional looks like a pointer but actualy is stack based).
It is nice, but it wouldnt need to behave like a pointer, syntactically speaking. It should have the same interface as the proper stream_socket, IMO. Only the copying being different.
Would it work for you? I'haven't really thought much about it, so I'm certanly missing something.
I think it would.
-- Giovanni P. Deretta
best regards, -- Felipe Magno de Almeida