Boost logo

Boost :

Subject: Re: [boost] [Container] Provide more guarantees for flat_multimap
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-08-15 15:38:26


El 15/08/2014 20:22, Niall Douglas escribió:
>> In which sense they have become enhanced?
>
> I stress the following is still in flux, but it's getting close to
> final. The following changes were mostly agreed with Howard and
> Jonathan, and none of the other authors of N3645 objected:

I think we should implement the minimal functions in order to improve
the proposal and add it to the standard when possible. Even in the
original proposal, "node_ptr extract(const key_type& x);" seems redundant.

> * node_ptr_type gains the get(), release() and reset() member
> functions so it now looks identical to a std::unique_ptr.

So why not call it unique_ptr ;-) The deleter type can be something like
allocator_deleter<A>, which calls a.destroy() + a.deallocate() via
allocator_traits. There are issues with allocator_traits::propagate_xxxx
but maybe solvable. A new type with nearly the same interface and
semantics as unique_ptr is something that sounds avoidable.

node_ptr_type is also a bit confusing, because it holds also an
allocator. node_ptr_type sounds a a pointer (raw or smart) to the
internal node type used by the container. Maybe node_holder is a bit
more accurate.

> * The following three new node_ptr_type factory functions are added:
>
> 1. template<class... Args> node_ptr_type make_node_ptr(Args&&...
> args);
>
> This allocates a node_ptr_type using the container allocator.

Thanks for the explanations, still don't see the need for too many
operations, but I will start with basic operations and start thinking
about your proposed extensions.

Best,

Ion


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