Gabriel Redner | 20 Aug 2012 19:53
Picon

[fusion] move-enabled containers?

Hi folks,

I have been starting to ease into C++11, and am currently looking to
add move-awareness to some classes which have members of boost::fusion
container types.  However, it seems that fusion containers are not
move-aware.  For a minimal example, take the code below:

==========
#include <boost/fusion/include/vector.hpp>
#include <iostream>

class noisy
{
public:
  noisy() { std::cout << "noisy()\n"; }
  noisy(const noisy&) { std::cout << "noisy(const noisy&)\n"; }
  noisy(noisy&&) { std::cout << "noisy(noisy&&)\n"; }
};

int main()
{
  typedef boost::fusion::vector<noisy, noisy> noisyVector;

  noisyVector n;
  std::cout << '\n';

  noisyVector n2(n);
  std::cout << '\n';

  noisyVector n3(std::move(n));
(Continue reading)

Mathias Gaunard | 20 Aug 2012 22:01

Re: [fusion] move-enabled containers?

On 20/08/2012 19:53, Gabriel Redner wrote:

> It is a simple matter to add move-awareness to fusion containers, or
> is there some technical reason why it cannot been done?  Or (perhaps
> more likely), am I misunderstanding something about the situation?

I had written a patch that made fusion::vector move-aware quite some 
time ago.
It was never included because supposedly there was a big C++11 rewrite 
of fusion coming up. But it seems it's not going to be released any time 
soon.

Maybe a simple patch to make the containers aware would be better for now.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Gabriel Redner | 20 Aug 2012 22:28
Picon

Re: [fusion] move-enabled containers?

I, for one, would welcome any progress (even incremental) on this
front.  There's always a big rewrite on the horizon, but that doesn't
mean that simple changes which improve things in the meantime should
not be incorporated!  Is there a bug associated with this patch?  I'd
be interested in trying it out.

Thanks,
-Gabe

On Mon, Aug 20, 2012 at 4:01 PM, Mathias Gaunard
<mathias.gaunard <at> ens-lyon.org> wrote:
> On 20/08/2012 19:53, Gabriel Redner wrote:
>
>> It is a simple matter to add move-awareness to fusion containers, or
>> is there some technical reason why it cannot been done?  Or (perhaps
>> more likely), am I misunderstanding something about the situation?
>
>
> I had written a patch that made fusion::vector move-aware quite some time
> ago.
> It was never included because supposedly there was a big C++11 rewrite of
> fusion coming up. But it seems it's not going to be released any time soon.
>
> Maybe a simple patch to make the containers aware would be better for now.
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
(Continue reading)

Christopher Schmidt | 20 Aug 2012 22:45

Re: [fusion] move-enabled containers?

Mathias Gaunard <mathias.gaunard <at> ens-lyon.org> writes:
> On 20/08/2012 19:53, Gabriel Redner wrote:
>
>> It is a simple matter to add move-awareness to fusion containers, or
>> is there some technical reason why it cannot been done?  Or (perhaps
>> more likely), am I misunderstanding something about the situation?
>
> I had written a patch that made fusion::vector move-aware quite some
> time ago.  It was never included because supposedly there was a big
> C++11 rewrite of fusion coming up. But it seems it's not going to be
> released any time soon.

Eventually the rewrite became a fork that does not want to be part of
either Boost or Boost.Fusion.  The current codebase[1] is pretty much
source compatible, convertible and adaptable from/to
Boost.Fusion/Boost.MPL.

On topic: you can easily implement your own move-aware container and
adapt it via the extension facility.

        Christopher

[1] http://ch.ristopher.com/git/?p=slim;a=summary

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Joel de Guzman | 21 Aug 2012 09:46
Picon
Favicon

Re: [fusion] move-enabled containers?

On 8/21/2012 4:45 AM, Christopher Schmidt wrote:
> Mathias Gaunard <mathias.gaunard <at> ens-lyon.org> writes:
>> On 20/08/2012 19:53, Gabriel Redner wrote:
>>
>>> It is a simple matter to add move-awareness to fusion containers, or
>>> is there some technical reason why it cannot been done?  Or (perhaps
>>> more likely), am I misunderstanding something about the situation?
>>
>> I had written a patch that made fusion::vector move-aware quite some
>> time ago.  It was never included because supposedly there was a big
>> C++11 rewrite of fusion coming up. But it seems it's not going to be
>> released any time soon.
>
> Eventually the rewrite became a fork that does not want to be part of
> either Boost or Boost.Fusion.  The current codebase[1] is pretty much
> source compatible, convertible and adaptable from/to
> Boost.Fusion/Boost.MPL.
>
> On topic: you can easily implement your own move-aware container and
> adapt it via the extension facility.

I still welcome a merger; as long as it is a merger and not a
complete overhaul.

Regards,
--

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

(Continue reading)

Joel de Guzman | 21 Aug 2012 09:46
Picon
Favicon

Re: [fusion] move-enabled containers?

On 8/21/2012 4:01 AM, Mathias Gaunard wrote:
> On 20/08/2012 19:53, Gabriel Redner wrote:
>
>> It is a simple matter to add move-awareness to fusion containers, or
>> is there some technical reason why it cannot been done?  Or (perhaps
>> more likely), am I misunderstanding something about the situation?
>
> I had written a patch that made fusion::vector move-aware quite some time ago.
> It was never included because supposedly there was a big C++11 rewrite of fusion coming
> up. But it seems it's not going to be released any time soon.
>
> Maybe a simple patch to make the containers aware would be better for now.

It's at the top of my list of things that should be done.
Yes, it is a simple matter to add move-awareness. I'd welcome
incremental patches.

Regards,
--

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Gmane