Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] Views of Associative Sequences
From: Christopher Schmidt (mr.chr.schmidt_at_[hidden])
Date: 2009-10-15 15:42:47


James Knight schrieb:
> I'm trying to find a solution to the following problem. If I have an
> associative sequence such as a fusion::set
> and I make a filter view of it, the view is not a model of an
> associative sequence and does not support the
> has_key and at_key functions. I can use fusion::as_set on the view to
> get an associative sequence again, but
> this doesn't really have the effect I want as it results in a set
> holding copies of the original data whereas the
> view referenced the original data. Example below.
>
> Would it be possible to create a view which supported the associative
> sequence interface? Any suggested alternative approaches?
>
> Thanks
> Nate

There is already a feature request for associative views (ticket 3473).
I will get down to it once I am granted write access to the trunk.
For now you could use my c++0x port of fusion. It correctly preserves
the category of the underlying sequence's for all views.
The port is fully backwards compatible, in terms of both features and
compiler (non-0x compiler are supported).
You can find the code in the sandbox (/sandbox/SOC/2009/fusion/).

-Christopher


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