Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-04-30 00:58:33


"Gennadiy Rozental" <rogeeff_at_[hidden]> wrote in message
news:aalaeh$3na$1_at_main.gmane.org...
> 1. You are using some third party library (Widget). In other case
you would
> just put you specialization into Widget header.

Modifying the headers of a third-party libraries is not something
recommendable as a programming technique. I assume widget.h was
defined by the writers of that library.

> 2. You code is used as third party library by somebody else. In
other case
> (you write code for yourself) you would know what kind of smart_ptr
to use
> for Widget. At least you would remember to use SharedWidgetPtr you
wrote for
> yourself.

Makes sense, but what to do if users employ class declarations to
minimize compile-time dependencies? That is a good technique
recommended by all experts.

> 3. Users of your library for some reasons ignore your interface
(that
> contain SharedWidgetPtr. in other case if SharedWidgetPtr is
implementation
> detail user of your library should not bother at all) and define
their own
> smart pointer on widget. That again could either fail to compile,
work if
> SharedWidgetPtr smart enough to properly convert into some other
smart_ptr.
> I should work also because SharedWidgetPtr is in you interface and
your
> specialization will also be there.

I don't understand the situation you describe.

Andrei


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