Changes between Initial Version and Version 1 of soc/2007/UserFriendlyGraphNewDocs


Ignore:
Timestamp:
May 17, 2007, 8:59:46 PM (15 years ago)
Author:
Andrew Sutton
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/UserFriendlyGraphNewDocs

    v1 v1  
     1It seems to me that the Boost.Graph documentation has gotten a little stale and needs a face-lift (i.e., rewrite to quickbook). There are also some older parts of the documentation that don't appear to align with current practice - especially those parts related to internal or bundled properties. If you read closely, you get the idea that bundled properties are the preferred technique, but they have yet to earn an entry into the table of contents.
     2
     3(Jeremy: yes, it would be good to make the bundled properties more visible and better documented.)
     4
     5Of course, the documentation isn't the only place where Boost.Graph doesn't align with the rest of Boost. For example, there is not `boost::graph` namespace. While this isn't exactly a tragedy for the ages, it would provide a clean separation from the rest of Boost. I am considering implementing my `[un]directed_graph`s in a `boost::graph` namespace.
     6
     7(Jeremy: yes, I'm in favor of going with a `boost::graph` namespace. It turns out that back when the BGL
     8was added to Boost we had not yet developed boost guidelines for namespace use.)
     9
     10Another advantage of adding the `boost::graph` namespace is that it provides a mechansim for doing some other interesting things like reordering the parameters of common Boost.Graph function calls. One of my biggest complaints when I started learning the library was that the graph was always passed as the last argument in these functions. This doesn't really mesh well with the common "C-style" object-oriented approach where the type of the first parameter generally indicates the type to which said function would belong as a method. Is it really that big of a deal? I don't know... but it would be pretty easy to reorder parameters likes this (for example):
     11
     12{{{
     13#!cpp
     14namespace boost {
     15  namespace graph {
     16    template <class C>
     17    inline std::pair<typename C::edge_descriptor, bool>
     18    add_edge(boost::directed_graph_helper<C>& g, typename C::vertex_descriptor u, C::vertex_descriptor v)
     19    {
     20      return boost::add_edge(u, v, g);
     21    }
     22  }
     23}
     24}}}
     25
     26Just a thought... There's probably some reason why this might break that I haven't thought of. And yes... that's what the signature of the `add_edge()` function actually looks like for directed graphs.
     27
     28(Jeremy: I'm not a fan of changing the parameter ordering as that change would have to propagate
     29throughout the BGL, and it would break lots of user code.)