Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-01-22 13:13:20


"Joaquín Mª López Muñoz" <joaquin_at_[hidden]> wrote

> If you accept this [no delete], I see no problem in *publicly* deriving
> A_with_data from A and use the former as a substitute of the latter:
>
There's one implicit assumption in this approach: user won't overwrite
(non-virtual) interface of container, e.g. no push_back() with logging
# of calls.

But this is not enforceable technically and having derived class makes it
tempting 'just to add some little functionality'.

The solution I have in mind is more complicated (for library writer)
but safer (IMHO) agains misuse.

/Pavel


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