Boost logo

Boost Users :

Subject: Re: [Boost-users] dynamic_properties and std::vector attributes
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-06-13 18:43:57


On Fri, 11 Jun 2010, Dominik Dahlem wrote:

> Jeremiah Willcock <jewillco_at_[hidden]> writes:
>> What error message do you get from the vector<int> example? I do not
>> see any obvious reason that a vector would behave differently from a
>> string, although the lack of a streaming operator or something might
>> break it. Is the issue in creating a dynamic_properties object (or
>> adding your property map to it) or in the output of the properties?
>>
>
>
> The issue is in creating the dynamic_properties object. The complete
> error message is as follows:

The dynamic_properties object needs to know how to print your property
(here vector<int>) to a stream and read it back; the lack of that is
causing the error message. The best way to solve the problem is to create
a new object that wraps a vector<int> and has customized operator<<() and
operator>>(); you can then use that as your property type. You cannot add
those operators to vector<int> itself AFAIK.

-- 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