Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2000-08-30 04:41:40

jsiek_at_[hidden] wrote:
> Yes, more complicated types such as a struct or std::list can be used
> as the plugin value type.

Nice, I'll check out the details.

> True, but that may actually be more confusing to use because the user
> would have to remember to add the const in situations like this:
> template <class Graph>
> void foo(const Graph& g) {
> typename vertex_property_accessor<const Graph, color_tag>::type
> color = get_color_property(g, color_tag());
> #elif OLD_WAY
> vertex_property_accessor<Graph, color_tag>::const_type
> color = get_color_property(g, color_tag());
> #endif
> }

So what? The "const" is simply at a different place. Plus, my
suggestion saves one underscore. :-)
(The OLD_WAY omits the required "typename", btw.)

> This has been nagging at me too. get_vertex_property_accessor() is
> pretty long, but I think it may be necessary.

I would omit the "get_" prefix, because there are no corresponding
"set_*" functions anyway.
Jens Maurer

Boost list run by bdawes at, gregod at, cpdaniel at, john at