void breadth_first_visit
    (const IncidenceGraph& g,
     typename graph_traits<IncidenceGraph>::vertex_descriptor s,
     const bgl_named_params<P, T, R>& params)
  {
    // The graph is passed by *const* reference so that graph adaptors
    // (temporaries) can be passed into this function. However, the
    // graph is not really const since we may write to property maps
    // of the graph.
    IncidenceGraph& ng = const_cast<IncidenceGraph&>(g);

    typedef graph_traits<IncidenceGraph> Traits;
    // Buffer default
    typedef typename Traits::vertex_descriptor vertex_descriptor;
    typedef boost::queue<vertex_descriptor> queue_t;
    queue_t Q;
    detail::wrap_ref<queue_t> Qref(Q);

    breadth_first_visit
      (ng, s,
       choose_param(get_param(params, buffer_param_t()), Qref).ref,
       choose_param(get_param(params, graph_visitor),
                    make_bfs_visitor(null_visitor())),
       choose_pmap(get_param(params, vertex_color), ng, vertex_color)
       );
  }
 void bfs_helper
   (VertexListGraph& g,
    typename graph_traits<VertexListGraph>::vertex_descriptor s,
    ColorMap color, 
    BFSVisitor vis,
    const bgl_named_params<P, T, R>& params)
 {
   typedef graph_traits<VertexListGraph> Traits;
   // Buffer default
   typedef typename Traits::vertex_descriptor Vertex;
   typedef boost::queue<Vertex> queue_t;
   queue_t Q;
   detail::wrap_ref<queue_t> Qref(Q);
   breadth_first_search
     (g, s, 
      choose_param(get_param(params, buffer_param_t()), Qref).ref,
      vis, color);
 }
 void bfs_helper
 (VertexListGraph& g,
  typename graph_traits<VertexListGraph>::vertex_descriptor s,
  EdgeType e,
  ColorMap color,
  BFSVisitor vis,
  const bgl_named_params<P, T, R>& params,
  boost::mpl::false_)
 {
   typedef graph_traits<VertexListGraph> Traits;
   // Buffer default
   typedef typename Traits::vertex_descriptor Vertex;
   typedef boost::queue<Vertex> queue_t;
   queue_t Q;
   breadth_first_search
     (g, s, e,
      choose_param(get_param(params, buffer_param_t()), boost::ref(Q)).get(),
      vis, color);
 }