From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2006-02-24 09:55:50
gruenedd_at_[hidden] ha escrito:
> What is the status of key swapping, issued here?
> Do you see a chance to have this included sometime? :]
Nothing like that has been included in Boost 1.34, and I decided
to finally not implement the idea because:
* It can be simulated externally (admittedly, not in an optimal
* I don't see as a commonly wanted feature.
* It implies weird semantics: swapping keys can result
in collisions arising in other indices. Consider for instance:
ordered_unique<identity<std::pair<int,int> > >
c.swap_keys(c.begin(),++c.begin()); // would yield a duplicate element (1,1)
Not that this cannot be handled, but it implies that a possible outcome
of swap_keys() is that both elements get deleted or the operation
rolled back, which is IMHO a little surprising to the unadvertent user.
I'm sorry the answer to your proposal is negative.
> Best Regards,
>  http://lists.boost.org/boost-users/2005/04/11223.php
On another issue, you might be interested to know that the problem
you brought forward in
has been solved in 1.34, and the very sample snippet you provided
then now compiles and works cleanly. The solution does not follow
your proposed approach, but uses boost::disable_if<> instead.
More info at
(third bullet). Best regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk