From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2005-08-31 17:51:08
--- Felipe Magno de Almeida <felipe.m.almeida_at_[hidden]> wrote:
> Does it worth rewriting virtual mechanisms? I think that boost
> libraries rely a lot on compilers doing the right job and write code
> that, when possible, are elegant.
> I think it is a lot more readable with virtual functions. And it's
> only with win_iocp_operation that this happens I think.
I think it was worth doing (otherwise I wouldn't have done it :) ). It
reduces code bloat with several compilers and did not affect the public
interface of asio.
> I can only enumerate two classes deriving from win_iocp_operation, no
> matter how the client uses the normal interface of library. The two I
> think are: win_iocp_demuxer_service::read_operation and
I used the technique where the derived classes are templates, and you
are likely to end up with hundreds of them in a typical program. Each
of those win_iocp_operation-derived classes takes a Handler as a
template argument, so whenever you write:
socket_.async_send(buf, length, boost::bind(...));
you would create a new win_iocp_operation-derived class.
> AFAICS, this workaround is only effective with VC6. I'm only saying
> all this because I'd like to have all libraries in boost rewriting
> virtual mechanisms.
And Borland C++ too, if I remember correctly. Boost.Function takes a
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk