Boost logo

Boost Users :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2005-03-14 10:38:28


On Mar 10, 2005, at 2:25 PM, Mauricio Gomes wrote:
> Could you please clarify this one to me ?
> You say "we really can't do (too much code !)" because of lack of
> time/resources to do it or because you think it is not the right thing
> to do ?
>
> Because in my opinion if it turns the library interface more
> convenient to use it seems like a good idea to do it.

It's mainly lack of resources: we would essentially have to take every
function in the graph library with a signature like "void foo(const
Graph& g)", and do a few things:
   (1) Remove the "const" from "const Graph" wherever it appears in the
algorithm, e.g., the signature becomes "void foo(Graph& g)"
   (2) Create a forwarding function "void foo(const Graph& g)" (with the
same signature as the old one) that forwards all of its parameters to
the non-constified version (the "const" will become part of the Graph
type).
   (3) In each of the algorithms, use typename remove_const<Graph>::type
instead of the type Graph, because graph_traits<const Graph> might not
be provided even though "graph_traits<Graph>" is.

I'm sure there are some portability issues that will crop up, because I
know some compilers don't reliably order between the "const Graph&" and
"Graph&" versions. It's a problem we can solve, of course, it's just a
huge amount of effort.

        Doug


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net