Re: [boost] Request for comments on super-project workflow doc
Robert Ramey wrote:
John Maddox brought up the question of "bridge libraries" (?) . An example would be the serialization library includes tests for boost variant but doesn't use boost variant itself. So if one includes just the modules which the serialization library uses to build - you'll get one set of modules which won't include the ability to run the test set. If you include all the modules which test set requires, you're going to include half of boost.
Yes, in general, there are three sets of dependencies: what the library headers depend on, what the library sources depend on, and what the library tests depend on, each a superset of the previous one. This doesn't make such a tool worthless or impossible though. And - FWIW - bridge libraries are something else, I think. The problem there is that, f.ex. a library X may not depend on the serialization library but making X's types serializable would. A bridge library XS could solve this by depending on both X and serialization and providing the necessary support. In principle, I've always argued that libraries should be designed in such a way so that adding support should not require including a header, but that's not the path of least resistance and if one doesn't specifically keep that requirement in mind, it's rare to see it satisfied. (And it's not always possible.) For example, here's how the smart pointers provide hash support without including anything: namespace boost { // hash_value template< class T > struct hash; template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) { return boost::hash< T* >()( p.get() ); } } // namespace boost and this is how a type may be specified to be a (boost::bind) placeholder, again without any inclusions: namespace boost { template<class T> struct is_placeholder; template<int I> struct is_placeholder< my_placeholder<I> > { BOOST_STATIC_CONSTANT( int, value = I ); }; } // namespace boost
Em 05/01/2014, às 01:38, "Peter Dimov"
In principle, I've always argued that libraries should be designed in such a way so that adding support should not require including a header, but that's not the path of least resistance and if one doesn't specifically keep that requirement in mind, it's rare to see it satisfied. (And it's not always possible.)
This is what forward headers are for, right? (Not that these are consistently provided in Boost, though.) Even if fwd headers were generally available, there is the problem of which submodule they should belong to in order to minimize dependencies: • boost/fwd? (one module for all) • boost/fwd_libx? (each its own fwd module) Joaquín M López Muñoz Telefónica Digital ________________________________ Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo. This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at: http://www.tid.es/ES/PAGINAS/disclaimer.aspx
JOAQUIN M. LOPEZ MUÑOZ wrote:
Em 05/01/2014, às 01:38, "Peter Dimov"
escreveu: In principle, I've always argued that libraries should be designed in such a way so that adding support should not require including a header, but that's not the path of least resistance and if one doesn't specifically keep that requirement in mind, it's rare to see it satisfied. (And it's not always possible.)
This is what forward headers are for, right?
Nope. You'll still have a dependency to the module in which the forwarding header resides. Unless we create a dedicated module to contain all forwarding headers, but this has its own problems.
On 5 January 2014 00:37, Peter Dimov
For example, here's how the smart pointers provide hash support without including anything:
namespace boost {
// hash_value
template< class T > struct hash;
This could break if hash was moved into a namespace, and imported using something like 'using boost::hash_v2::hash'. I'm not actually going to do that in this case, but it's a possibility elsewhere. But that's not really why I'm posting. It's just to say that I've made a few updates to the super project page, the changes are here: https://svn.boost.org/trac/boost/wiki/SuperProjectWorkflow?action=diff&version=13&old_version=6 And to save looking for the start of the thread, the page is at: https://svn.boost.org/trac/boost/wiki/SuperProjectWorkflow
participants (3)
-
Daniel James
-
JOAQUIN M. LOPEZ MUÑOZ
-
Peter Dimov