|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-02-18 22:03:27
At 10:26 AM 2/5/2005, christopher diggins wrote:
>A general question w.r.t platform dependencies, what is the standard way
to
>proceed when authouring a boost library which varies on the platform? For
>instance is the following acceptable for Boost:
>
>#ifdef BOOST_WINDOWS
> typdef win32_profiler_policy default_profiler_policy;
>#elif BOOST_POSIX
> typdef posix_profiler_policy default_profiler_policy;
>#else
> typdef boost_default_profiler_policy default_profiler_policy;
>#endif
That's done in several existing libraries.
Try to limit inclusion of platform dependent headers to implementation
(.cpp) files; don't include platform dependent headers from the public
boost headers.
That isn't always possible, but a lot of users find inclusion of headers
like <windows.h> to be very distasteful, and don't like to get such headers
as a side effect of including a boost header.
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk