Boost logo

Boost :

From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2004-04-17 06:16:44


Vladimir Prus wrote:

> Daniel Wallin wrote:
>> template<class G, class A0, .., class AN>
>> typename enable_if_graph<
>> G
>> , typename graph_traits<G>::edge_descriptor
>> >::type
>> add_edge(
>> typename graph_traits<G>::vertex_descriptor u
>> , typename graph_traits<G>::vertex_descriptor v
>> , A0 const& a0
>> , ...
>> , AN const& an
>> , G& g)
>> {
>> typename keywords_for_graph<G>::type kw;
          ^^^^^^^^ ^^
>> return add_edge_impl(u, v, g, kw(a0, ..., an));
>
>
> Should there be kw()(a0...) ? It seems the syntax that works for me.

No, kw isn't a type here.

[snip]
> I wonder what's the reason to require conversion/construction of keywords<>?
> Couldn't (color = 10, name = "foo") already create a type with proper
> operator[])?

Yes, it could. The point of keywords<> is to enable positional
parameters as well as named (and also the SFINAE stuff). Anyway, I
checked in some changes to the sandbox that enables list creation with
operator,. Could you try that version out?

-- 
Daniel Wallin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk