Solar wrote:
Col. Kernel is right, though - STL style allocater functions would be a point where placement new would come in handy.
Well... any time you wanted to place an object in memory you control separately. That includes allocators and shared memory.
I've never seen anyone actually using the option of defining your own allocator functions, either... (You'd probably do this if you were optimizing like hell, but who does these days where labor is expensive, but better hardware is cheap...)
I'll be at Breakpoint 2006, I promise.
It came in handy when trying to cut down on memory requirements for a large linked list or tree of one object type, so I made a separate allocator and used it. I can't stand people making algorithmic improvements and completely ignoring plain common sense.
Candy wrote:
It came in handy when trying to cut down on memory requirements for a large linked list or tree of one object type, so I made a separate allocator and used it. I can't stand people making algorithmic improvements and completely ignoring plain common sense.
No doubt and 100% ACK. But here at work our production server is running debug code because the additional testing of release code would cost more than the additional bits of RAM and CPU cycles... the beautiful difference between "business" and what you would like to do...
Every good solution is obvious once you've found it.
@candy&solar: You tell how it's been at breakpoint 2006, yeah?
Some photostory. *gg*
It's a pity I canna show up there, but for one I have to attend university and for second I have to go to work *?rks* (and not too much free days left, eh?)
Ah... Breakpoint 2006 is where Candy, Pype and myself will meet each other the first time in person. BI was referring to Candy's earlier reference to that upcoming occasion.
Every good solution is obvious once you've found it.
Anyway a quick question on multimap iterators.
Multimaps allows more than I element with the same key.
So if I traverse through the list how does it go through the elements in the list (I can't test this out because my CYGWIN g++ is acting funny when I try to declare a multimap)
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".
Every good solution is obvious once you've found it.
@NEO: if you have a problem with what I am posting you may as well consider talking to me in plain sentences so we can speak about the problem and get rid of the one or other difference, ok?