Boost logo

Boost :

Subject: Re: [boost] Proposal: Linear map
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-07-18 10:49:46


On Wednesday 18 July 2012 07:40:17 Amir Ansari wrote:
> Thanks. This is exactly what I was looking for. Some questions:
>
> 1. Is there any container that allows inserting without providing a value of
> the contained type, but rather, some other type? Essentially, it would rely
> on a non-default constructor that takes the other type as input.

Yes, many Boost containers support emplace*() methods. In C++11, STL
containers also support it.

> 2. Is there some specialization for flat_set with the same semantics as
> ptr_vector ?

I'm not sure I understand. Do you intend to store pointers in flat_set? If so,
you can store std::unique_ptr's or shared_ptr's and specify your custom
ordering predicate to order pointers by their pointees.


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