
"Peter Petrov" <ppetrov@ppetrov.com> wrote in message news:dflha4$dab$1@sea.gmane.org...
Matt Hurd wrote:
There are two other alternatives:
1. enable both by configuration macro (cpp becomes is used as an ipp) - unusual
2. decide on which should be header only to suit lib authors as I suspect simple synch primitives such as mutexes and their locks are needed by most authors.
On balance the volume of the voices seems to indicate a preference for library approach rather than a header only attempt.
Votes? Further pros or cons?
My vote would be for the hybrid approach - i.e. basic stuff is inline by default, but in the rare cases when system headers cause problems, it should be possible to switch to library-based implementation using a configuration macro. This should please everyone.
Trying to please everyone is a recipe for bloated difficult to maintain code, among other problems, IMO. Including system API headers from within our public library headers is poor software engineering practice, and except in the most exceptional circumstances we should avoid it. Beyond immediate problems, there is a long history of latent problems surfacing when porting such code to new platforms. --Beman