Help with Cryptic C++ code
Re:Help with Cryptic C++ code
BI approximates his mood using a Lagrange algorithm. Sometimes he's a jolly chap to have around, sometimes he's a bit testy. ;D
Every good solution is obvious once you've found it.
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Help with Cryptic C++ code
@solar: yeah, that's a taylor series with a lagrange remainder member (in german it's the lagrang'sches Restglied)*gg*
@Neo: Slow down, breathe and relax: I have been talking to solar about an event, then you ask anyone but me what the heck I'm talking about and then you wonder why I'm a bit testy about that? Oh, come on, lad.
Now, I suppose we'll have a coffee and give it a rest, ok?
@Neo: Slow down, breathe and relax: I have been talking to solar about an event, then you ask anyone but me what the heck I'm talking about and then you wonder why I'm a bit testy about that? Oh, come on, lad.
That#s what it is about, fyiErr.. ??
That was to beyond_infinity's post.
Now, I suppose we'll have a coffee and give it a rest, ok?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:Help with Cryptic C++ code
Think you need to do that bro.beyond infinity wrote: @Neo: Slow down, breathe and relax:
The first post from you in this thread (which is about C++ multimaps BTW) is the one where you where talk about breakpoint 2006, which confused me. Hence the "Err..??"I have been talking to solar about an event, then you ask anyone but me what the heck I'm talking about and then you wonder why I'm a bit testy about that? Oh, come on, lad.
And then you ask me if I have a problem with what you are posting? Funny.
Sure.Now, I suppose we'll have a coffee and give it a rest, ok?
Only Human
Re:Help with Cryptic C++ code
Just wanted to confirm this. If I have a [font=Courier New]multimap<priority, Struct1>[/font]Solar wrote: When constructing a multimap, you can pass to the constructor a function object (predicate) that does the ordering. By default, this is [tt]less[/tt], meaning that, if you get two elements X, Y with X->first == Y->first, you will get one after another, but the exact order is unspecified (as neither is "less" than the other). This is called "strict weak ordering".
and I insert items like
[font=Courier New]<1,struct_var1>
<0,struct_var2>
<1,struct_var3>
<2,struct_var4>
<0,struct_var5>[/font]
and when I traverse through this multimap will I get the elements in this order
I did get this with gcc (is it the same with the others?)struct_var2
struct_var5
struct_var1
struct_var3
struct_var4
Only Human
Re:Help with Cryptic C++ code
No.Neo wrote: ...when I traverse through this multimap will I get the elements in this order...
You will get struct_var2 and struct_var5 before you get the others, and you will get struct_var4 last. But whether you get struct_var2 before or after struct_var5 is not defined, and neither is whether you get struct_var1 before or after struct_var3.
Actually, the sequence could be different the very next time you iterate through the map. Edit: Not really sure here, but better safe than sorry.
It is very dangerous to go "trial and error" in these things. The next version of GCC might change this behaviour, and silently (i.e., without mentioning the fact anywhere), because the standard does not guarantee a strong ordering here.
Every good solution is obvious once you've found it.
Re:Help with Cryptic C++ code
Hmmm........ ok. Should keep that in mind then.
@Solar: Thanks.
@Solar: Thanks.
Only Human
Re:Help with Cryptic C++ code
The order probably is stable but unpredictable up-front. The multimap probably uses a set for each key, with a tree or a hash implementation behind it.Neo wrote: Hmmm........ ok. Should keep that in mind then.
@Solar: Thanks.