Re: [Boost-users] [BGL] Updating to CVS version, typedef ... Graph not working?!

I think there's probably a better way: put all the concepts in a nested namespace of boost and then add a using-directive to expose them in boost... Although I'd really like to see the whole test program first, because it's not obvious where/how the collision occurs. -----Original Message----- From: dgregor@osl.iu.edu Subj: Re: [Boost-users] [BGL] Updating to CVS version,typedef ... Graph not working?! Date: Wed May 31, 2006 10:31 am Size: 927 bytes To: boost-users@lists.boost.org cc: dave@boost-consulting.com
I switched from 1.33.1 to CVS, and after that, my test programm did not work any longer ...
The relevant part is:
typedef adjacency_list
> > > > MyGraph; (Before it was Graph instead of MyGraph). [snip] Can someone explain to me what's happening here?
This looks like fallout from recent changes to the concept checking library. There is now a template called "Graph" in namespace boost, and we find that as well as your "Graph" typedef. This might force us to go back to the "Concept" suffix on concept checking templates, if this problem affects many compilers :( Doug -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

dave@boost-consulting.com schrieb:
I think there's probably a better way: put all the concepts in a nested namespace of boost and then add a using-directive to expose them in boost... Although I'd really like to see the whole test program first, because it's not obvious where/how the collision occurs.
See attached ...

On May 31, 2006, at 12:25 PM,
I think there's probably a better way: put all the concepts in a nested namespace of boost and then add a using-directive to expose them in boost... Although I'd really like to see the whole test program first, because it's not obvious where/how the collision occurs.
Hmmm, that doesn't work for me. The following patch does work, but
it's pretty ugly :(
Doug
Index: graph_concepts.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/graph/graph_concepts.hpp,v
retrieving revision 1.43
diff -u -r1.43 graph_concepts.hpp
--- graph_concepts.hpp 2 May 2006 15:06:06 -0000 1.43
+++ graph_concepts.hpp 31 May 2006 18:14:09 -0000
@@ -22,6 +22,26 @@
namespace boost
{
+// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
+// you want to use vector_as_graph, it is! I'm sure the graph
+// library leaves these out all over the place. Probably a
+// redesign involving specializing a template with a static
+// member function is in order :(
+//
+// It is needed in order to allow us to write using boost::vertices as
+// needed for ADL when using vector_as_graph below.
+#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) \
+ && !BOOST_WORKAROUND(__GNUC__, <= 2) \
+ && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# define BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
+#endif
+
+#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
+template <class T>
+typename T::ThereReallyIsNoMemberByThisNameInT vertices(T const&);
+#endif
+
+ namespace concepts {
BOOST_concept(MultiPassInputIterator,(T)) {
~MultiPassInputIterator() {
BOOST_CONCEPT_ASSERT((InputIterator<T>));
@@ -143,25 +163,6 @@
G g;
};
-// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
-// you want to use vector_as_graph, it is! I'm sure the graph
-// library leaves these out all over the place. Probably a
-// redesign involving specializing a template with a static
-// member function is in order :(
-//
-// It is needed in order to allow us to write using boost::vertices as
-// needed for ADL when using vector_as_graph below.
-#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) \
- && !BOOST_WORKAROUND(__GNUC__, <= 2) \
- && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-# define BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
-#endif
-
-#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
-template <class T>
-typename T::ThereReallyIsNoMemberByThisNameInT vertices(T const&);
-#endif
-
BOOST_concept(VertexListGraph,(G))
: Graph<G>
{
@@ -471,6 +472,31 @@
I i, j;
};
+ } // end namespace concepts
+
+ using boost::concepts::MultiPassInputIteratorConcept;
+ using boost::concepts::GraphConcept;
+ using boost::concepts::IncidenceGraphConcept;
+ using boost::concepts::BidirectionalGraphConcept;
+ using boost::concepts::AdjacencyGraphConcept;
+ using boost::concepts::VertexListGraphConcept;
+ using boost::concepts::EdgeListGraphConcept;
+ using boost::concepts::VertexAndEdgeListGraphConcept;
+ using boost::concepts::EdgeMutableGraphConcept;
+ using boost::concepts::VertexMutableGraphConcept;
+ using boost::concepts::MutableGraphConcept;
+ using boost::concepts::MutableIncidenceGraphConcept;
+ using boost::concepts::MutableBidirectionalGraphConcept;
+ using boost::concepts::MutableEdgeListGraphConcept;
+ using boost::concepts::VertexMutablePropertyGraphConcept;
+ using boost::concepts::EdgeMutablePropertyGraphConcept;
+ using boost::concepts::AdjacencyMatrixConcept;
+ using boost::concepts::ReadablePropertyGraphConcept;
+ using boost::concepts::PropertyGraphConcept;
+ using boost::concepts::LvaluePropertyGraphConcept;
+ using boost::concepts::BufferConcept;
+ using boost::concepts::ColorValueConcept;
+ using boost::concepts::BasicMatrixConcept;
} // namespace boost
#include
participants (3)
-
dave@boost-consulting.com
-
Doug Gregor
-
Jens Müller