Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3446: [boost] [fusion] transform does not return a mutable view
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-14 06:45:27
#3446: [boost] [fusion] transform does not return a mutable view
--------------------------------+-------------------------------------------
Reporter: jhellrung@⦠| Owner: djowel
Type: Feature Requests | Status: new
Milestone: Boost 1.41.0 | Component: fusion
Version: Boost 1.40.0 | Severity: Optimization
Keywords: |
--------------------------------+-------------------------------------------
Comment(by djowel):
> First, I wasn't aware that assignment of a Boost.Fusion sequence to,
e.g., a boost::array would work? I admit I've never tried it...
Ah indeed it won't. boost::array is not a fusion container. So you have a
good use case for copy indeed. I suggest you polish it, provide docs, and
I'd gladly add that to the library.
Now, back to what you want. It seems that you don't need in-place mutation
at all!
copy(transform(src, project()), dest);
where project returns src[i].member_var for each member. This is as fast
as you expect it to be since transform is lazily evaluated.
Thoughts?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3446#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC