Boost logo

Boost :

Subject: Re: [boost] [fusion] Trouble using BOOST_FUSION_ADAPT_ADT with boost::fusion::operator<
From: Joel de Guzman (joel_at_[hidden])
Date: 2012-01-17 20:14:46

On 1/18/2012 2:28 AM, GOODHART, TAYLOR wrote:
> Hi all,
> I'm attempting to adapt a third-party struct into a fusion sequence
> using BOOST_FUSION_ADAPT_ADT to get access to a nice operator<.
> Unfortunately compilation fails and I'm not sure if it's a bug or me
> using the library incorrectly. As best I can read the error message, it
> looks like the code is attempting to compare adt_attribute_proxy structs
> instead of the values represented by these. Below is some code that
> demonstrates the problem. Can anybody help me out?

You've bumped into a limitation of proxies. Fusion adapted ADTs do
not have access to the actual L-values of the class members, but only
through get and set. As such, it actually exposes proxy elements
(adt_attribute_proxy) instead of the actual elements. The only thing
you can do with these proxies is either to get the values or set the


Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at