|
Boost Users : |
Subject: Re: [Boost-users] [fusion] Are Sequence stream IO operators recursive?
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-11-03 08:04:44
On 11/3/2010 7:04 PM, Hugh Dickinson wrote:
>> From the error message, I'm guessing that you are adapting a struct to fusion. Fusion
>> is not picking the right overload for your struct. In the second case, you are in the
>> right namespace and ADL is kicking in just fine. Try providing a<< overload in the
>> namespace of your struct.
>>
>> Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
>>
> Hi Joel, thanks for the reply. I don't really understand what you mean, could you
> explain in a bit more detail. I would have thought that since PMT::QE::DataSet is a
> fusion sequence, then the overload defined in boost/fusion/sequence/io/detail/out.hpp
> should have been selected.
Fusion relies on its elements having an operator<< available through ADL.
It does not really care if the elements are themselves fusion elements.
It only cares that an operator<< can be found for each of its elements.
In your case, ADL looks for an operator<< in PMT::QE::DataSet, not in
fusion.
Regards,
-- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
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