On Tue, Jan 08, 2002 at 12:16:56AM +0100, Lars Gullik Bjønnes wrote:
> Now read about pair a_eq.insert(t).
> And then read about [] again in 23.3.1.2.
Indeed, I missed that.
I stand corrected.
Andre'
--
André Pönitz .. [EMAIL PROTECTED]
On Mon, Jan 07, 2002 at 05:41:11PM +0100, Lars Gullik Bjønnes wrote:
> AFAIK insert will not insert a new key if it already exists. (only
> for map and set of course)
>From CD2:
23.1.2 Associative containers[lib.associative.reqmts]
---
On Mon, Jan 07, 2002 at 04:44:23PM +0100, Juergen Vigna wrote:
> > 'insert' creates a new entry or overwrite an ol;d entry with the same key,
> > exactly what operator[]() would do.
>
> Well it seems it does not at least not in the implementation that I use!
I don't believe you. Try again... ;-)
On 07-Jan-2002 Andre Poenitz wrote:
> There is no way to have multiple entries for the same key in a std::map.
> One would have to use a std::multimap if that feature was needed.
>
> 'insert' creates a new entry or overwrite an ol;d entry with the same key,
> exactly what operator[]() would do.
On 07-Jan-2002 Lars Gullik Bjønnes wrote:
> but I'd also say that it is an error trying to store a bufferview in
> the cache when it is already there. F.ex. the TextCache requires that
> the BufferView stored therein is _not_ viewed in any LyXView.
>
> I think that the cache in insettext very w
On 07-Jan-2002 Lars Gullik Bjønnes wrote:
> I am pretty sure you did it...
> (at least I am quite sure that I didn't, I only did the BufferView
> TextCache.)
Well anyway it has to be fixed so I would need an experts council what I
should do, I would do this:
-cache.insert(make_pair(bv,
On 07-Jan-2002 Lars Gullik Bjønnes wrote:
> map translate;
>
> translate["Hei"] = "Hello";
>
> translate.insert(make_pair("Hei", "Hi"));
>
> then the insert will not work since "Hei" is already set.
So in this case we should never use insert but always the assignment
operator?
Jug
On 07-Jan-2002 Lars Gullik Bjønnes wrote:
> The BufferView in actual use should _never_ be in the cache. So when
> you search in the cach for a BufferView and find the one you want to
> use, it should also be removed from the cache.
Care to explain? I don't think I did that part of the code som
On 07-Jan-2002 Juergen Vigna wrote:
> I ask this because it seems to me that it does only insert a new item
> but does not substitute the other one and then when searching for the
> LyXText of this BufferView we have multiple choices.
Well it really seems it does not! This could be a reason for