
Thank you! Actually, boost::array is an unfortunate choice, as it does not model a Sequence. But I have successfully built a vertex list out of std::deque. Which has suggested me a couple of more questions: 1) I should also overload iterator_stability() for my container, shouldn't I? 2) I did a quick test: adding vertices to a graph (adjacency_list) whose vertex list is implemented as a deque turns out to be faster than adding vertices to a vector-based (or even a list-based) graph. Why isn't there any "dequeS" tag in BGL? Regards Nicola
Hi everybody, I want to use my custom container as a vertex list in a graph. I have followed the documentation, but I don't know exactly how I should overload the push() and erase() functions.
Sorry, looks like the documentation is incomplete in that regard. I'll fix that.
You can find examples of push() and erase() in:
boost/pending/container_traits.hpp
The following example code, using boost::array, gives an error: "no matching function for call to 'container_category (boost::array
&)". Can someone help me? You'll need to define a container_category function for boost::array. There are examples of this also in container_traits.hpp.
Cheers, Jeremy

Hi Nicola, On Sep 18, 2005, at 12:57 PM, Nicola Vitacolonna wrote:
Thank you! Actually, boost::array is an unfortunate choice, as it does not model a Sequence.
If you define your own push and erase, instead of using the default ones (that rely on container_category), then you should be able to get this to work... however, you'll still have to deal with the problem that boost::array is not resizable... perhaps by managing the real size yourself.
But I have successfully built a vertex list out of std::deque. Which has suggested me a couple of more questions:
1) I should also overload iterator_stability() for my container, shouldn't I?
Yes, though I don't think adjacency_list currently uses that.
2) I did a quick test: adding vertices to a graph (adjacency_list) whose vertex list is implemented as a deque turns out to be faster than adding vertices to a vector-based (or even a list-based) graph. Why isn't there any "dequeS" tag in BGL?
Historical accident. If you'd like we could add your implementation for deque. Cheers, Jeremy
participants (2)
-
Jeremy Siek
-
Nicola Vitacolonna