Re: [sigc] Forward declaration of signal.h



On Thu, 12 Aug 2004, Murray Cumming wrote:

> But in most cases people would still need to include the real header to
> actually use the API, so I don't see how it could make a big difference,
> though it would confuse users of your API who would get strange compiler
> errors.

Instead of having signal.h included X times, it will only be included once
in the source file. (And perhaps in a few headers that can't avoid it)

You will get errors that anyone resonably competent can figure out. (It
will afterall complain about the lack of sigc::* stuff) Nothing will force
you to use the forward declaring headers.

> I guess it could be useful if you have sigc classes only in your protected
> or private API, but the whole point of libsigc++ is that it allows public
> communication between objects.

Forward declaring the classes does not hinder communication. Besides, it's
quite the opposite. It is in the hidden parts of your API that you can
skip including the sigc headers. But in the headers your user will be
using, you cannot expect him to have already included the required sigc
headers.

Rakshasa



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]