------------------------------
Date: Thu, 30 Jun 2011 15:00:13 -0400 (EDT) From: Jeremiah Willcock
To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Graph]questions regarding boost::graph::adjacency_list constructor prototype On Thu, 30 Jun 2011, Tan, Tom (Shanghai) wrote:
While studying boost.graph, I stumbled upon this constructor
????template <class EdgeIterator>
??? adjacency_list(EdgeIterator first, EdgeIterator last,
????????????????????????? vertices_size_type n,
????????????????????????? edges_size_type = 0,
????????????????????????? const GraphProperty& p = GraphProperty())
????? : Base(n, first, last), m_property(new graph_property_type(p))
{ }
I have 2 questions here:
-????????? What does ?edges_size_type = 0,? means here?? Assigning a
value to a TYPE, instead of a parameter? Can
anyone please point me to an explanation of this grammar usage?
It's like if the code was "edges_size_type x = 0", but since the
definition: parameter
is not used, removing the name avoids compiler warnings.
Nice to know this trick. Never knew that the 'x' can be omitted in this case.
-????????? Why the necessary of edges_size_type = 0 parameter,?
since there?s a range pair of ?EdgeIterator first,
EdgeIterator last??
It is not necessary, since the value of that parameter is never used. It is probably there match the interface of some other constructor, either in adjacency_list or some other graph class.
I guessed so but it's better to confirmed. Thanks for the help. -Tom