Boost logo

Boost Users :

From: Jens Müller (jens.mueller_at_[hidden])
Date: 2007-02-04 06:20:38


Jens Müller schrieb:
> Jens Müller schrieb:
>
>> Unfortunately, my C++ seems to be too bad to implement this ...
>>
>> Please see the attached source files ...
>>
>> The errors I'm currently getting:
>
> OK, fixed some missing boost::, and used size_t* instead of size_t[] as
> the template parameter for the pmap type.
>
> Still get errors:
>
> bfs_map_test.cpp: In function `int main(int, char**)':
> bfs_map_test.cpp:69: error: no matching function for call to
> `MapAsColorMap<main(int, char**)::Graph, size_t*,
> int>::MapAsColorMap(size_t[5], int)'
> bfs_distmap_as_color_map.hpp:40: note: candidates are:
> MapAsColorMap<main(int, char**)::Graph, size_t*,
> int>::MapAsColorMap(const MapAsColorMap<main(int, char**)::Graph,
> size_t*, int>&)
> bfs_distmap_as_color_map.hpp:48: note:
> MapAsColorMap<Graph, ReadablePropertyMap,
> ColorValue>::MapAsColorMap(ReadablePropertyMap&, typename
> boost::property_traits<IndexMap>::value_type) [with Graph = main(int,
> char**)::Graph, ReadablePropertyMap = size_t*, ColorValue = int]
>
>
> Can someone please help me?

This works:

template<typename Graph, typename ReadablePropertyMap, typename ColorValue>
class MapAsColorMap
{
public:
  typedef typename boost::graph_traits<Graph>::vertex_descriptor key_type;
  typedef ColorValue value_type;
  typedef ColorValue reference_type;
  typedef boost::read_write_property_map_tag category;
  ColorValue get(key_type key);
  MapAsColorMap(ReadablePropertyMap& pm,
// typename boost::property_traits<ReadablePropertyMap>::value_type
white):
        size_t white):
   white_(white), pm_(pm) {};

private:
  typename boost::property_traits<ReadablePropertyMap>::value_type white_;
  ReadablePropertyMap& pm_;
};

, with ReadablePropertyMap=size_t*

Why isn't typename
boost::property_traits<ReadablePropertyMap>::value_type=size_t?

Or if it is, why doesn't it work?

Cheers,

Jens


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net