Boost logo

Boost :

Subject: Re: [boost] [core] A better boost::swap
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2014-12-27 12:14:56


2014-12-26 12:05 GMT+01:00 Antony Polukhin <antoshkka_at_[hidden]>:

> Hi all,
>
> Ion Gaztañaga implemented a very good swap that used move emulation when
> possible and has all the features of boost::swap:
> http://www.boost.org/doc/libs/develop/boost/move/adl_move_swap.hpp
>
> I've tried to change default implementation of ::boost::swap to
>
> #include <boost/move/adl_move_swap.hpp>
> namespace boost
> {
> template<class T1, class T2>
> BOOST_GPU_ENABLED
> void swap(T1& left, T2& right)
> {
> ::boost::adl_move_swap(left, right);
> }
> }
>
> All the tests of the Boost.Swap passed. Ion's solution looks better than
> existing boost::swap.
>
> Are there any reasons not to change the existing implementation of
> Boost.Swap to Ion's version?
>
> --
> Best regards,
> Antony Polukhin

You may find it a silly argument, and it goes back to these dependency
graph discussions. If you look at the dependency report, like this one
http://www.pdimov.com/tmp/report-d5ca5be/module-levels.html
It says Boost.Core is level 2 (so, fairly primitive) while Boost.Move is
Level 6. If you make Core depend on Move, it is not that primitive anymore.
Of course, the idea with improving swap is sound. I just thought I would
bring it up.

Regards,
&rzej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk