During Broker refactoring, I noticed the following: all headers in broker/* include either standard library headers or Broker headers. This appears to be by design, which makes sense to me.
As a library writer, one faces the tricky question of exposing headers from dependencies. For example, Broker currently has it's own broker::util::optional, which ships as a (now outdated) copy of the corresponding CAF source. I am inclined to change this copy to an include that points directly into CAF headers, with the following rationale: Broker already depends on CAF, and a system that has CAF installed always ships with CAF headers. (Strictly speaking, we're not copying the code of <vector> into broker either, but relying on it via an include.) >From a user perspective, nothing changes here. A user will never include a CAF header, but may rely on it during compilation. Here's what I an example of what I want broker/util/optional.hh to look like: #include "caf/optional.hpp" // <--- New include. namespace broker { namespace util { using caf::optional; }} Currently we have: // Note the absence of a CAF include. namespace broker { namespace util { template <class T> class optional { // code copied from CAF }; }} Relying on the former form is more maintainable, and allows us to stay in sync with upstream fixes and improvements on the CAF side. I'm checking in here on the list to see whether anyone has objections. Matthias _______________________________________________ bro-dev mailing list bro-dev@bro.org http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev