|
Boost : |
From: Aaron Windsor (aaron.windsor_at_[hidden])
Date: 2007-12-19 21:47:59
On Dec 19, 2007 9:03 PM, Dean Michael Berris <mikhailberis_at_[hidden]> wrote:
> Hey!
>
> On Dec 20, 2007 3:04 AM, Cromwell Enage <sponage_at_[hidden]> wrote:
> > --- Dean Michael Berris wrote:
> > > Hi Guys,
> >
> > Kumusta ka, pare!
> >
>
> I'm good. :)
>
> > > Is there a definitive guide in the Boost.Graph
> > > documentation about how to create custom
> > > selectors?
> >
> > Try:
> >
> > <http://www.boost.org/libs/graph/doc/using_adjacency_list.html#sec:custom-storage>
> >
>
> I tried this, but I got a bunch of errors. Basically, what I tried
> precisely are:
>
> struct pooled_vectorS { }; // the selector
>
> namespace boost {
> template <typename ValueType>
> struct container_gen<pooled_vectorS, ValueType> {
> typedef std::vector<ValueType, pool_allocator<ValueType> > type;
> };
> };
>
> Unfortunately, when I try to do:
>
> typedef adjacency_list<
> pooled_vectorS,
> pooled_vectorS,
> undirectedS,
> property<vector_name_t, int,
> property<vector_distance_t, int,
> property<vector_color_t, int>
> >
> >
> > graph_type;
>
> graph_type my_graph;
>
> I get a whole slew of errors which all boils down to:
>
> /usr/local/lib/boost/boost/graph/adjacency_list.hpp:282: error: no
> type named 'type' in 'struct
> boost::parallel_edge_traits<pooled_vectorS>'
>
> Am I missing something here?
>
> I'm using the version in r41409.
Hi Dean,
See the last paragraph on the page Cromwell gave a link to above,
which explains how to specialize this traits class. You probably want:
template <>
struct parallel_edge_traits<pooled_vectorS>
{
typedef allow_parallel_edge_tag type;
};
Regards,
Aaron
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk