Boost logo

Boost Users :

Subject: Re: [Boost-users] trying to build custom property_map
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-04-01 08:17:33


On Wed, 31 Mar 2010, Sandeep Gupta wrote:

>
>
>
> Hi,
>  I created a  simple property_map as follows:
>
> struct VecMap
> {
>  typedef int value_type;
>
>  typedef int key_type;
>  typedef  read_write_property_map_tag category;
>
>  typedef int* reference;
>  std::vector<int> vec_store;
>
> };
> void put(VecMap& rmap, int key, int val)
>
> {
>  rmap.vec_store[key] = val;
>
> }
> int get(VecMap& rmap, int key)
>
> {
>  return rmap.vec_store[key];
>
> }
> /// End code
> The compiler gcc-4.4.1 against latest boost-trunk gives errorerror: no type named value_type in struct
> boost::property_traits<VecMap>
> The code however compiles fine with boost_1_40. Please take a look.
> The full code is available here http://codepad.org/KtmbXkLa
>
>
> I tried the code you posted (at codepad) with GCC 3.4, 4.1, and 4.4.0 and did not receive an error.  Note that in the trunk, the
> property_map header file is <boost/property_map/property_map.hpp>.
>
> -
>
> The posted code works with earlier version of boost. However when I change the header to boost/property_map/property_map.hpp and use
> boost-trunk that it start giving errors.
> I compiled against gcc 4.4.1, 4.4 and 4.2. It gives the same  error for all the three.

I changed the code to use the new header file and compiled against the
trunk and still don't get any errors. What errors are you seeing (i.e.,
the full gcc output)?

-- Jeremiah Willcock


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