Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"We will bury you." -- Nikita Kruschev


devel / comp.lang.c++ / Re: std::map advocacy

SubjectAuthor
* Ain't that beautiful ?Bonita Montero
`* Re: Ain't that beautiful ?Michael S
 +* Re: Ain't that beautiful ?Sam
 |`* Re: Ain't that beautiful ?Scott Lurndal
 | `* Re: Ain't that beautiful ?Michael S
 |  `* Re: Ain't that beautiful ?Bonita Montero
 |   `* Re: Ain't that beautiful ?Michael S
 |    `* Re: Ain't that beautiful ?Bonita Montero
 |     `* Re: Ain't that beautiful ?Chris M. Thomasson
 |      `* Re: Ain't that beautiful ?Bonita Montero
 |       `* Re: Ain't that beautiful ?Scott Lurndal
 |        `* Re: Ain't that beautiful ?Bonita Montero
 |         `- Re: Ain't that beautiful ?Chris M. Thomasson
 `* Re: Ain't that beautiful ?Bonita Montero
  `* Re: Ain't that beautiful ?Michael S
   `* Re: Ain't that beautiful ?Bonita Montero
    `* Re: Ain't that beautiful ?Scott Lurndal
     `* Re: Ain't that beautiful ?Bonita Montero
      `* Re: Ain't that beautiful ?Scott Lurndal
       +- Re: Ain't that beautiful ?Bonita Montero
       `* Re: Ain't that beautiful ?Paavo Helde
        +* Re: Ain't that beautiful ?Scott Lurndal
        |+* Re: Ain't that beautiful ?Bonita Montero
        ||`* Re: Ain't that beautiful ?wij
        || `* Re: Ain't that beautiful ?Bonita Montero
        ||  `- Re: Ain't that beautiful ?wij
        |`- Re: Ain't that beautiful ?Michael S
        `* Re: Ain't that beautiful ?Michael S
         +* Re: Ain't that beautiful ?David Brown
         |+* Re: Ain't that beautiful ?Michael S
         ||+- Re: Ain't that beautiful ?Scott Lurndal
         ||+- Re: Ain't that beautiful ?David Brown
         ||`- Re: Ain't that beautiful ?Bonita Montero
         |`* std::map advocacyMichael S
         | +* Re: std::map advocacyDavid Brown
         | |`* Re: std::map advocacyMichael S
         | | `* Re: std::map advocacyDavid Brown
         | |  +* Re: std::map advocacyMichael S
         | |  |+* Re: std::map advocacywij
         | |  ||`* Re: std::map advocacyMichael S
         | |  || `* Re: std::map advocacywij
         | |  ||  `* Re: std::map advocacyMichael S
         | |  ||   `- Re: std::map advocacyBonita Montero
         | |  |+- Re: std::map advocacyDavid Brown
         | |  |`* Re: std::map advocacyScott Lurndal
         | |  | `* Re: std::map advocacyMichael S
         | |  |  +* Re: std::map advocacyScott Lurndal
         | |  |  |`* Re: std::map advocacyMichael S
         | |  |  | `- Re: std::map advocacyScott Lurndal
         | |  |  `* Re: std::map advocacyDavid Brown
         | |  |   `* Re: std::map advocacyMichael S
         | |  |    `- Re: std::map advocacyDavid Brown
         | |  `* Re: std::map advocacyRichard Damon
         | |   `* Re: std::map advocacyDavid Brown
         | |    `* Re: std::map advocacyJames Kuyper
         | |     `* Re: std::map advocacyDavid Brown
         | |      `* Re: std::map advocacyMichael S
         | |       `* Re: std::map advocacyDavid Brown
         | |        `* Re: std::map advocacyMichael S
         | |         +- Re: std::map advocacyDavid Brown
         | |         `* Re: std::map advocacyJames Kuyper
         | |          `* Re: std::map advocacyMichael S
         | |           `* Re: std::map advocacyDavid Brown
         | |            `* Re: std::map advocacywij
         | |             +* Re: std::map advocacyDavid Brown
         | |             |+* Re: std::map advocacyBonita Montero
         | |             ||`* Re: std::map advocacyMichael S
         | |             || `* Re: std::map advocacyBonita Montero
         | |             ||  `* Re: std::map advocacyMichael S
         | |             ||   `- Re: std::map advocacyBonita Montero
         | |             |`* Re: std::map advocacywij
         | |             | `- Re: std::map advocacyDavid Brown
         | |             `* Re: std::map advocacyMichael S
         | |              `- Re: std::map advocacyPaavo Helde
         | +* Re: std::map advocacyScott Lurndal
         | |+* Re: std::map advocacyMichael S
         | ||`- Re: std::map advocacyBonita Montero
         | |`- Re: std::map advocacyPaavo Helde
         | `* Re: std::map advocacyBonita Montero
         |  `* Re: std::map advocacyMichael S
         |   `* Re: std::map advocacyBonita Montero
         |    `* Re: std::map advocacyMichael S
         |     `* Re: std::map advocacyBonita Montero
         |      `* Re: std::map advocacyMichael S
         |       +- Re: std::map advocacyMichael S
         |       `- Re: std::map advocacyBonita Montero
         +* Re: Ain't that beautiful ?Bonita Montero
         |`* Re: Ain't that beautiful ?Michael S
         | `- Re: Ain't that beautiful ?Bonita Montero
         `- Re: Ain't that beautiful ?Paavo Helde

Pages:1234
Re: std::map advocacy

<uv3pvc$asrv$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3561&group=comp.lang.c%2B%2B#3561

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Tue, 9 Apr 2024 18:22:04 +0200
Organization: A noiseless patient Spider
Lines: 84
Message-ID: <uv3pvc$asrv$1@dont-email.me>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 09 Apr 2024 16:22:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="17bc22c42028aca8876adaf53505a968";
logging-data="357247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cxxy6jsLzlMIktuDjpIKtADDUxHI+RxQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:myVeiteleFuypjr3NmP2ItNkccM=
Content-Language: en-GB
In-Reply-To: <20240409181252.0000479f@yahoo.com>
 by: David Brown - Tue, 9 Apr 2024 16:22 UTC

On 09/04/2024 17:12, Michael S wrote:
> On Tue, 9 Apr 2024 15:13:54 +0200
> David Brown <david.brown@hesbynett.no> wrote:
>
>> On 09/04/2024 12:27, Michael S wrote:
>>> On Tue, 9 Apr 2024 09:45:08 +0200
>>> David Brown <david.brown@hesbynett.no> wrote:
>>>
>>
>>>> Typically, however, small embedded systems and hard real-time
>>>> systems have little need for things like std::map<> or
>>>> std::vector<>, so it is not much of an issue in practice. But it
>>>> is one of the reasons why I rule out such containers for use in
>>>> the code I write.
>>>
>>> You're arguing about unimportant theoretical possibilities.
>>>
>>
>> Perhaps you don't understand about what "real-time" means. Real-time
>> development does not care about theoretical possibilities of
>> different implementations, because you fix your system at /one/
>> implementation. But it /does/ care about theoretical possibilities of
>> what could happen in that one system. I don't care if some
>> implementation uses Pink-Green trees to get O(1) average speed, or
>> another one uses Purple-Brown trees to get O(n ^ 27) space
>> complexity. I only care about the implementation I am using. And I
>> don't care about its average speed, I only care about its worst-case
>> spaces and times.
>>
>> I don't care if it does 99.999% of its operations within 1µs, I care
>> if I can /guarantee/ that /every/ case is completed with 1 second.
>>
>> Sometimes in real-time systems you will prefer a linear search
>> through a list, because it is easier to be sure of your limits and
>> the correctness of the code in all cases - with the simpler code,
>> it's likely that your worst case times are better than many kinds of
>> tree.
>>
>> And the same applies to space considerations - the worst case is the
>> only relevant case.
>>
>
> You continue to argue about unimportant theoretical possibilities.
> std::map is *never* Pink-Green or Purple-Brown, It is either
> Guibas-Sedgewick, better known as red-black or, very rarely,
> Adelson-Velsky-Landis.

There are no guarantees about that at all. I am sure you are correct
that these are the most common types of implementation - or rather, the
implementations used in the most commonly used C++ standard libraries.
But they are not the only possibilities - do you know that these are
what are used by IAR's C++ library, and Metrowerks, and EASTL, and any
other C++ library? No, you do not. You /might/ know that these are
used in gcc's libc++ and llvm's library, because that is publicly
available information. But you don't know that other implementations
might have different implementations due to different requirements, such
as absolute minimum ram space or code space, or maybe a wider B-tree
aimed at improving cache friendliness, or something designed for
parallel access.

But let's assume that the implementation has both amortized and
worst-case complexity O(log n) - that's a reasonable assumption and fits
your insistence that it will be either a type of red-black tree or some
kind of AVL tree. Where does that get us?

Do we have a guarantee on the constant factors for the O(log n)
complexity? No.

Do we have a way to test the worst-case times? No.

Do we know if an insertion or deletion will lead to a memory allocation
or deallocation? No.

Do we have any idea of a worst-case time for such allocations or
deallocations? No.

Do we have a solid upper bound on the time a given operation will take? No.

Can we use a std::map in a hard real-time system without doing a great
deal of work measuring and characterising a particular implementation? No.

That's not theoretical - it's real.

Re: std::map advocacy

<uv5bbr$pndc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3564&group=comp.lang.c%2B%2B#3564

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Wed, 10 Apr 2024 02:24:59 -0400
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uv5bbr$pndc$1@dont-email.me>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 10 Apr 2024 06:25:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f3750c68072f1d140c67c0700c16d53d";
logging-data="843180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KHuTPEZcfp5h6nWSr7ykkgfUWAuMZV7I="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:txP4mQb1uXgy8P7hBjZjh4bg5YI=
Content-Language: en-US
In-Reply-To: <20240409181252.0000479f@yahoo.com>
 by: James Kuyper - Wed, 10 Apr 2024 06:24 UTC

On 4/9/24 11:12, Michael S wrote:
> On Tue, 9 Apr 2024 15:13:54 +0200
> David Brown <david.brown@hesbynett.no> wrote:
....
>> complexity. I only care about the implementation I am using. And I
>> don't care about its average speed, I only care about its worst-case
>> spaces and times.
....
> You continue to argue about unimportant theoretical possibilities.

He's doing the exact opposite of worrying about theorectical
possibilities. He's saying that what the implementation he's using
actually does is more important than your instance that it can only be
doing something else.

Re: std::map advocacy

<20240411000737.000038e8@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3566&group=comp.lang.c%2B%2B#3566

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 00:07:37 +0300
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20240411000737.000038e8@yahoo.com>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad>
<uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com>
<uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com>
<uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com>
<uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org>
<uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me>
<uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com>
<uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com>
<uv5bbr$pndc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 10 Apr 2024 23:07:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="69234085f7a21ab9378ceafe0de3e820";
logging-data="1265614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pdNwDvIysBdf4hp9U3poSmJzYLahjTmY="
Cancel-Lock: sha1:89z2v3HJPzxuoTymNLdfEytL6Xk=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Wed, 10 Apr 2024 21:07 UTC

On Wed, 10 Apr 2024 02:24:59 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:

> On 4/9/24 11:12, Michael S wrote:
> > On Tue, 9 Apr 2024 15:13:54 +0200
> > David Brown <david.brown@hesbynett.no> wrote:
> ...
> >> complexity. I only care about the implementation I am using. And
> >> I don't care about its average speed, I only care about its
> >> worst-case spaces and times.
> ...
> > You continue to argue about unimportant theoretical possibilities.
>
> He's doing the exact opposite of worrying about theorectical
> possibilities. He's saying that what the implementation he's using
> actually does is more important than your instance that it can only be
> doing something else.

He can check and see by himself that all toolsets that he uses have
std::map implemented on top of red-black tree. It's easy, sources are
here. But it seems arguing is more fun.
And one of the the posibilities that he mentiond (wider nodes) does not
look like even theoretically possible for C++17 and later, because it
would mess with extract() and the rest of node-based APIs.

Re: std::map advocacy

<uv854o$1j1af$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3569&group=comp.lang.c%2B%2B#3569

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 09:57:12 +0200
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <uv854o$1j1af$1@dont-email.me>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 09:57:13 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bfe965ad2c744120201e8335c561a037";
logging-data="1672527"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xgAO0OIsfI1GD3HMbjeKkUYybPzT06M0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:10zJh+NjmsdpZx14AaBwYnUa7hY=
In-Reply-To: <20240411000737.000038e8@yahoo.com>
Content-Language: en-GB
 by: David Brown - Thu, 11 Apr 2024 07:57 UTC

On 10/04/2024 23:07, Michael S wrote:
> On Wed, 10 Apr 2024 02:24:59 -0400
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>
>> On 4/9/24 11:12, Michael S wrote:
>>> On Tue, 9 Apr 2024 15:13:54 +0200
>>> David Brown <david.brown@hesbynett.no> wrote:
>> ...
>>>> complexity. I only care about the implementation I am using. And
>>>> I don't care about its average speed, I only care about its
>>>> worst-case spaces and times.
>> ...
>>> You continue to argue about unimportant theoretical possibilities.
>>
>> He's doing the exact opposite of worrying about theorectical
>> possibilities. He's saying that what the implementation he's using
>> actually does is more important than your instance that it can only be
>> doing something else.
>
> He can check and see by himself that all toolsets that he uses have
> std::map implemented on top of red-black tree. It's easy, sources are
> here. But it seems arguing is more fun.

No, it is /not/ easy - sources for big C++ standard libraries are far
from simple to understand. (That is in no way a criticism - I
understand why they are written the way they are.) I could look up
sources and see identifiers or comments saying they use red-black trees,
but as I have already explained several times, knowing that does not
give me anywhere close to the guarantees that are needed before the code
is useable for hard real-time systems. Of course I could study the code
for long enough, and do enough analysis and testing to establish timing
guarantees - but it would be vastly simpler and faster to write my own
data structures from scratch to fulfil real-time requirements. I would
not expect my implementations to be faster on average for general usage
- indeed, I'd expect them to be a lot slower. But /knowing/ the limits
is the important point, not the speed.

If you don't know what real-time requirements are - what the phrase
"real-time" means - that's fine. Most people don't need to know about
it. Even most people who work with small embedded systems as a
profession don't really understand it - most embedded systems don't have
serious real-time requirements. But some do, and the more advanced C++
standard library features are not something that could be considered for
them.

If you are interesting it knowing what real-time means, I can try to
explain. If you'd rather continue playing salesman for C++ standard
library containers, then we'll just have to leave it.

> And one of the the posibilities that he mentiond (wider nodes) does not
> look like even theoretically possible for C++17 and later, because it
> would mess with extract() and the rest of node-based APIs.
>

Re: std::map advocacy

<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3574&group=comp.lang.c%2B%2B#3574

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wynii...@gmail.com (wij)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 19:25:44 +0800
Organization: A noiseless patient Spider
Lines: 80
Message-ID: <9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Date: Thu, 11 Apr 2024 13:25:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c4f778d2786d64eccc2815f27fc07dca";
logging-data="1736139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oNQvbPFf67ZgKu7LQmVwc"
User-Agent: Evolution 3.50.2 (3.50.2-1.fc39)
Cancel-Lock: sha1:lCV9MaS5cHIC4pTDLi+mKsAjp64=
In-Reply-To: <uv854o$1j1af$1@dont-email.me>
 by: wij - Thu, 11 Apr 2024 11:25 UTC

On Thu, 2024-04-11 at 09:57 +0200, David Brown wrote:
> On 10/04/2024 23:07, Michael S wrote:
> > On Wed, 10 Apr 2024 02:24:59 -0400
> > James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
> >
> > > On 4/9/24 11:12, Michael S wrote:
> > > > On Tue, 9 Apr 2024 15:13:54 +0200
> > > > David Brown <david.brown@hesbynett.no> wrote:
> > > ...
> > > > > complexity.  I only care about the implementation I am using..  And
> > > > > I don't care about its average speed, I only care about its
> > > > > worst-case spaces and times.
> > > ...
> > > > You continue to argue about unimportant theoretical possibilities.
> > >
> > > He's doing the exact opposite of worrying about theorectical
> > > possibilities. He's saying that what the implementation he's using
> > > actually does is more important than your instance that it can only be
> > > doing something else.
> >
> > He can check and see by himself that all toolsets that he uses have
> > std::map implemented on top of red-black tree. It's easy, sources are
> > here. But it seems arguing is more fun.
>
> No, it is /not/ easy - sources for big C++ standard libraries are far
> from simple to understand.  (That is in no way a criticism - I
> understand why they are written the way they are.)  I could look up
> sources and see identifiers or comments saying they use red-black trees,
> but as I have already explained several times, knowing that does not
> give me anywhere close to the guarantees that are needed before the code
> is useable for hard real-time systems.  Of course I could study the code
> for long enough, and do enough analysis and testing to establish timing
> guarantees - but it would be vastly simpler and faster to write my own
> data structures from scratch to fulfil real-time requirements.  I would
> not expect my implementations to be faster on average for general usage
> - indeed, I'd expect them to be a lot slower.  But /knowing/ the limits
> is the important point, not the speed.
>
Yup, the good point of std::list/set/map/... is that users can use it nearly
blindingly. But when you calculate the gains/losses, things are different than
what is usually thought.

> If you don't know what real-time requirements are - what the phrase
> "real-time" means - that's fine.  Most people don't need to know about
> it.  Even most people who work with small embedded systems as a
> profession don't really understand it - most embedded systems don't have
> serious real-time requirements.  But some do, and the more advanced C++
> standard library features are not something that could be considered for
> them.
>
> If you are interesting it knowing what real-time means, I can try to
> explain.  If you'd rather continue playing salesman for C++ standard
> library containers, then we'll just have to leave it.
>
> > And one of the the posibilities that he mentiond (wider nodes) does not
> > look like even theoretically possible for C++17 and later, because it
> > would mess with extract() and the rest of node-based APIs.
> >
>
>

Re: std::map advocacy

<uv8il4$1lr7f$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3575&group=comp.lang.c%2B%2B#3575

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 13:47:48 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uv8il4$1lr7f$1@dont-email.me>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 13:47:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bfe965ad2c744120201e8335c561a037";
logging-data="1764591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/x02sO78Yn1NKwNBic1yC6ACSyiR3YW4I="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:Z1uOPb6SY8VsvmRBCd+XZy3+QC4=
In-Reply-To: <9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
Content-Language: en-GB
 by: David Brown - Thu, 11 Apr 2024 11:47 UTC

On 11/04/2024 13:25, wij wrote:

> Yup, the good point of std::list/set/map/... is that users can use it nearly
> blindingly. But when you calculate the gains/losses, things are different than
> what is usually thought.
>
Yes, most C++ users can use these standard library containers "blindly".
And for others that have special requirements, things like custom
allocators and other flexibilities can help.

But people working on real-time systems, high-reliability systems,
safety-related systems, or very resource-constrained systems can't do
/anything/ blindly.

Re: std::map advocacy

<uv8jkr$1m2fk$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3576&group=comp.lang.c%2B%2B#3576

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 14:04:47 +0200
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uv8jkr$1m2fk$1@raubtier-asyl.eternal-september.org>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 14:04:43 +0200 (CEST)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="60f5ab8b13164cf87238791110f9e482";
logging-data="1772020"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8x9gyO28uja1BPXs8mtmgVMk0M7jURUk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:9hgwOH5N6Fy641q1uDBUlvwwLgA=
In-Reply-To: <uv8il4$1lr7f$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Thu, 11 Apr 2024 12:04 UTC

Am 11.04.2024 um 13:47 schrieb David Brown:

> Yes, most C++ users can use these standard library containers "blindly".
>  And for others that have special requirements, things like custom
> allocators and other flexibilities can help.

Custom allocators only make sense with a vector. With all other con-
tainers the standars library does a allocator_traits<X>::rebind_alloc<Y>
to have a different allocator type. F.e. a map never uses the supplied
allocator since the nodes also contain the links. For me the whole
allocator-concept mostly doesn't make sense because of that.

Re: std::map advocacy

<20240411161308.00006542@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3579&group=comp.lang.c%2B%2B#3579

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 16:13:08 +0300
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20240411161308.00006542@yahoo.com>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad>
<uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com>
<uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com>
<uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com>
<uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org>
<uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me>
<uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com>
<uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com>
<uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com>
<uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 15:13:11 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="948a3d46d314eac708dbd3a3c8e1a9c2";
logging-data="1721437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dLVkaYwAZM/LlnMzLkeCKLuDqYzEtxNk="
Cancel-Lock: sha1:QcT0B7jeRvtXa86uTsx+AtiXiEQ=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Thu, 11 Apr 2024 13:13 UTC

On Thu, 11 Apr 2024 19:25:44 +0800
wij <wyniijj5@gmail.com> wrote:

> Yup, the good point of std::list/set/map/... is that users can use it
> nearly blindingly. But when you calculate the gains/losses, things
> are different than what is usually thought.
>

I can not see a single reason to use std::list. It brings nothing to the
table relatively to my own lists and just reduces flexibility and
transparency.
Associative containers are very different.
Even std::vector is different - while it does not bring to table a lot,
it brings quite enough to prefer std over home-bred.

Re: std::map advocacy

<20240411161800.00001239@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3580&group=comp.lang.c%2B%2B#3580

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 16:18:00 +0300
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <20240411161800.00001239@yahoo.com>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad>
<uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com>
<uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com>
<uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com>
<uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org>
<uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me>
<uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com>
<uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com>
<uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com>
<uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
<uv8jkr$1m2fk$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 15:18:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="948a3d46d314eac708dbd3a3c8e1a9c2";
logging-data="1721437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+r7Z0UJ74qDVz4/5+kzKeE0SY8Ly6YS6A="
Cancel-Lock: sha1:aOoBfjbIjYXSw4d5PhnXErMqlhE=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Thu, 11 Apr 2024 13:18 UTC

On Thu, 11 Apr 2024 14:04:47 +0200
Bonita Montero <Bonita.Montero@gmail.com> wrote:

> Am 11.04.2024 um 13:47 schrieb David Brown:
>
> > Yes, most C++ users can use these standard library containers
> > "blindly". And for others that have special requirements, things
> > like custom allocators and other flexibilities can help.
>
> Custom allocators only make sense with a vector. With all other con-
> tainers the standars library does a
> allocator_traits<X>::rebind_alloc<Y> to have a different allocator
> type. F.e. a map never uses the supplied allocator since the nodes
> also contain the links. For me the whole allocator-concept mostly
> doesn't make sense because of that.
>

I tried to implement custom allocator for std::multiset and actually
succeed. But it was too hard and too ugly. So I happily forgot how to
do it 2 hours later.

Re: std::map advocacy

<uv8on5$1n56q$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3581&group=comp.lang.c%2B%2B#3581

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 15:31:21 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uv8on5$1n56q$1@raubtier-asyl.eternal-september.org>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
<uv8jkr$1m2fk$1@raubtier-asyl.eternal-september.org>
<20240411161800.00001239@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 15:31:17 +0200 (CEST)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="60f5ab8b13164cf87238791110f9e482";
logging-data="1807578"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5ybB777osVe0JufjnJdB6NOSCoj/h6AU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZZWmNpY85Hg1wEfZw9bLjclr0Zw=
Content-Language: de-DE
In-Reply-To: <20240411161800.00001239@yahoo.com>
 by: Bonita Montero - Thu, 11 Apr 2024 13:31 UTC

Am 11.04.2024 um 15:18 schrieb Michael S:
> On Thu, 11 Apr 2024 14:04:47 +0200
> Bonita Montero <Bonita.Montero@gmail.com> wrote:
>
>> Am 11.04.2024 um 13:47 schrieb David Brown:
>>
>>> Yes, most C++ users can use these standard library containers
>>> "blindly". And for others that have special requirements, things
>>> like custom allocators and other flexibilities can help.
>>
>> Custom allocators only make sense with a vector. With all other con-
>> tainers the standars library does a
>> allocator_traits<X>::rebind_alloc<Y> to have a different allocator
>> type. F.e. a map never uses the supplied allocator since the nodes
>> also contain the links. For me the whole allocator-concept mostly
>> doesn't make sense because of that.
>>
>
> I tried to implement custom allocator for std::multiset and actually
> succeed. But it was too hard and too ugly. So I happily forgot how to
> do it 2 hours later.

To make this work a custom allocator should be rebind<>-able to any
type, thereby having a typed malloc()-like allocator for all types
and sizes.

Re: std::map advocacy

<20240411163954.00002ba2@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3582&group=comp.lang.c%2B%2B#3582

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 16:39:54 +0300
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <20240411163954.00002ba2@yahoo.com>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad>
<uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com>
<uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com>
<uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com>
<uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org>
<uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me>
<uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com>
<uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com>
<uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com>
<uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
<uv8jkr$1m2fk$1@raubtier-asyl.eternal-september.org>
<20240411161800.00001239@yahoo.com>
<uv8on5$1n56q$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 15:39:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="948a3d46d314eac708dbd3a3c8e1a9c2";
logging-data="1721437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jH9nXfoYcoGjoTn9yKOB2e+piBXN/jQE="
Cancel-Lock: sha1:Edzcyif0SG5u2mVI/wk0zC4O4w0=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Thu, 11 Apr 2024 13:39 UTC

On Thu, 11 Apr 2024 15:31:21 +0200
Bonita Montero <Bonita.Montero@gmail.com> wrote:

> Am 11.04.2024 um 15:18 schrieb Michael S:
> > On Thu, 11 Apr 2024 14:04:47 +0200
> > Bonita Montero <Bonita.Montero@gmail.com> wrote:
> >
> >> Am 11.04.2024 um 13:47 schrieb David Brown:
> >>
> >>> Yes, most C++ users can use these standard library containers
> >>> "blindly". And for others that have special requirements, things
> >>> like custom allocators and other flexibilities can help.
> >>
> >> Custom allocators only make sense with a vector. With all other
> >> con- tainers the standars library does a
> >> allocator_traits<X>::rebind_alloc<Y> to have a different allocator
> >> type. F.e. a map never uses the supplied allocator since the nodes
> >> also contain the links. For me the whole allocator-concept mostly
> >> doesn't make sense because of that.
> >>
> >
> > I tried to implement custom allocator for std::multiset and actually
> > succeed. But it was too hard and too ugly. So I happily forgot how
> > to do it 2 hours later.
>
> To make this work a custom allocator should be rebind<>-able to any
> type, thereby having a typed malloc()-like allocator for all types
> and sizes.
>
>

The point is to not be more generic than absolutely necessary for
particular application.

Re: std::map advocacy

<uv8rlk$1nq5a$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3583&group=comp.lang.c%2B%2B#3583

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 16:21:44 +0200
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <uv8rlk$1nq5a$1@raubtier-asyl.eternal-september.org>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
<uv8jkr$1m2fk$1@raubtier-asyl.eternal-september.org>
<20240411161800.00001239@yahoo.com>
<uv8on5$1n56q$1@raubtier-asyl.eternal-september.org>
<20240411163954.00002ba2@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 16:21:41 +0200 (CEST)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="60f5ab8b13164cf87238791110f9e482";
logging-data="1829034"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ur4h0RPOCR7J81ITgLdxTRlP52f2q9rk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4fhPijtP77gCyC3EtoJmee+hzw8=
In-Reply-To: <20240411163954.00002ba2@yahoo.com>
Content-Language: de-DE
 by: Bonita Montero - Thu, 11 Apr 2024 14:21 UTC

Am 11.04.2024 um 15:39 schrieb Michael S:
> On Thu, 11 Apr 2024 15:31:21 +0200
> Bonita Montero <Bonita.Montero@gmail.com> wrote:
>
>> Am 11.04.2024 um 15:18 schrieb Michael S:
>>> On Thu, 11 Apr 2024 14:04:47 +0200
>>> Bonita Montero <Bonita.Montero@gmail.com> wrote:
>>>
>>>> Am 11.04.2024 um 13:47 schrieb David Brown:
>>>>
>>>>> Yes, most C++ users can use these standard library containers
>>>>> "blindly". And for others that have special requirements, things
>>>>> like custom allocators and other flexibilities can help.
>>>>
>>>> Custom allocators only make sense with a vector. With all other
>>>> con- tainers the standars library does a
>>>> allocator_traits<X>::rebind_alloc<Y> to have a different allocator
>>>> type. F.e. a map never uses the supplied allocator since the nodes
>>>> also contain the links. For me the whole allocator-concept mostly
>>>> doesn't make sense because of that.
>>>>
>>>
>>> I tried to implement custom allocator for std::multiset and actually
>>> succeed. But it was too hard and too ugly. So I happily forgot how
>>> to do it 2 hours later.
>>
>> To make this work a custom allocator should be rebind<>-able to any
>> type, thereby having a typed malloc()-like allocator for all types
>> and sizes.
>>
>>
>
> The point is to not be more generic than absolutely necessary for
> particular application.
>

A rebind()-able allocator is as generic as possible. There's no way
to have a pool-allocator for a container's given type since the type
is always rebound.

Re: std::map advocacy

<9723720a24ac8cbeb5072912a25eb1c69a7c4870.camel@gmail.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3584&group=comp.lang.c%2B%2B#3584

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wynii...@gmail.com (wij)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 22:40:34 +0800
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <9723720a24ac8cbeb5072912a25eb1c69a7c4870.camel@gmail.com>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240404215534.0000623d@yahoo.com>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Date: Thu, 11 Apr 2024 16:40:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c4f778d2786d64eccc2815f27fc07dca";
logging-data="1777410"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7lixjsgFwhyHN3Q6C3e29"
User-Agent: Evolution 3.50.2 (3.50.2-1.fc39)
Cancel-Lock: sha1:n1UVVdahiA14lj4FSJBbU/WDIKM=
In-Reply-To: <uv8il4$1lr7f$1@dont-email.me>
 by: wij - Thu, 11 Apr 2024 14:40 UTC

On Thu, 2024-04-11 at 13:47 +0200, David Brown wrote:
> On 11/04/2024 13:25, wij wrote:
>
> > Yup, the good point of std::list/set/map/... is that users can use it nearly
> > blindingly. But when you calculate the gains/losses, things are different than
> > what is usually thought.
> >
> Yes, most C++ users can use these standard library containers "blindly".
>   And for others that have special requirements, things like custom
> allocators and other flexibilities can help.
>
> But people working on real-time systems, high-reliability systems,
> safety-related systems, or very resource-constrained systems can't do
> /anything/ blindly.
>

Understand. People here seemingly do not program hard-wares (thus don't really
understand C, IMO). I quit hard-ware things (and C) for a long time. But, for
embedded systems, esp. real real-time systems, my first choice was Assembly..
I am not aware whether C++ is suitable for real real-time systems or not.

I had encountered programming for buggy hardwares (sound efffect chips, and some
badly designed hard-wares, because the company wanted to save money) where
some pins had to be read/written in a peculiar way (language optimization will
be a problem here). And, an embedded system that had to simulate UART where
timeing is really critical in order to communicate with other devices (every
machine tick counts). And a system that uses two DOS machines to work as one
machine where COM1 is set to the highest priority to provide basic
synchronization mechanism...
And, for embedded systems, RAM/pins is money, related to survival of product.
Average people don't understand this.

High-level languages normally involves more supporting tools, all these need
update and learning, not necessarily good.

Re: std::map advocacy

<uv8tlj$1o8cd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3585&group=comp.lang.c%2B%2B#3585

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 16:55:47 +0200
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <uv8tlj$1o8cd$1@dont-email.me>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<uv8il4$1lr7f$1@dont-email.me>
<9723720a24ac8cbeb5072912a25eb1c69a7c4870.camel@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Apr 2024 16:55:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bfe965ad2c744120201e8335c561a037";
logging-data="1843597"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SxDIXb696lMsw3BjNBzOrZPpc7IxvnHs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:FjfyrBstU89M6SyR4OVFoCW8IE0=
Content-Language: en-GB
In-Reply-To: <9723720a24ac8cbeb5072912a25eb1c69a7c4870.camel@gmail.com>
 by: David Brown - Thu, 11 Apr 2024 14:55 UTC

On 11/04/2024 16:40, wij wrote:
> On Thu, 2024-04-11 at 13:47 +0200, David Brown wrote:
>> On 11/04/2024 13:25, wij wrote:
>>
>>> Yup, the good point of std::list/set/map/... is that users can use it nearly
>>> blindingly. But when you calculate the gains/losses, things are different than
>>> what is usually thought.
>>>
>> Yes, most C++ users can use these standard library containers "blindly".
>>   And for others that have special requirements, things like custom
>> allocators and other flexibilities can help.
>>
>> But people working on real-time systems, high-reliability systems,
>> safety-related systems, or very resource-constrained systems can't do
>> /anything/ blindly.
>>
>
> Understand. People here seemingly do not program hard-wares (thus don't really
> understand C, IMO). I quit hard-ware things (and C) for a long time. But, for
> embedded systems, esp. real real-time systems, my first choice was Assembly.
> I am not aware whether C++ is suitable for real real-time systems or not.
>

C++ is fine for hard real-time and safety-critical systems - as long as
you use an appropriate subset of the features, and as long as your
development process is suitable. It's not any different from any other
language in that respect. And I'd rate C++ above C, and C above
assembly, for suitability.

> I had encountered programming for buggy hardwares (sound efffect chips, and some
> badly designed hard-wares, because the company wanted to save money) where
> some pins had to be read/written in a peculiar way (language optimization will
> be a problem here).

You need to know how to access the hardware properly, and how to work
with the language and the tools to achieve that. Sometimes this can be
a bit fiddly, but it is entirely possible to do in a solid and reliable way.

> And, an embedded system that had to simulate UART where
> timeing is really critical in order to communicate with other devices (every
> machine tick counts). And a system that uses two DOS machines to work as one
> machine where COM1 is set to the highest priority to provide basic
> synchronization mechanism...
> And, for embedded systems, RAM/pins is money, related to survival of product.
> Average people don't understand this.
>
> High-level languages normally involves more supporting tools, all these need
> update and learning, not necessarily good.
>

Sure. (But don't update the build tools for a project - they are part
of the project.)

Re: std::map advocacy

<uv8v0c$1ohnh$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3586&group=comp.lang.c%2B%2B#3586

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: eesn...@osa.pri.ee (Paavo Helde)
Newsgroups: comp.lang.c++
Subject: Re: std::map advocacy
Date: Thu, 11 Apr 2024 18:18:35 +0300
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uv8v0c$1ohnh$1@dont-email.me>
References: <uumqfq$q6p0$1@raubtier-asyl.eternal-september.org>
<uunpq1$14t9p$1@raubtier-asyl.eternal-september.org>
<20240405175257.000066a0@yahoo.com>
<uup56c$1esu3$1@raubtier-asyl.eternal-september.org>
<GLYPN.6$zaCc.4@fx08.iad>
<uupmvv$1j8sq$1@raubtier-asyl.eternal-september.org>
<03_PN.124502$U1cc.11575@fx04.iad> <uurm8q$24ka4$1@dont-email.me>
<20240407160050.00004370@yahoo.com> <uuu98b$2qou0$1@dont-email.me>
<20240407183854.00000797@yahoo.com> <uuuga5$2s7td$2@dont-email.me>
<20240407193505.00004d17@yahoo.com> <uv0dd7$3diif$1@dont-email.me>
<uv0jb2$ck7p$3@i2pn2.org> <uv0sd6$3hbhr$1@dont-email.me>
<uv1vco$3pmea$1@dont-email.me> <uv2rm5$3g4p$1@dont-email.me>
<20240409132722.0000414d@yahoo.com> <uv3euj$83fj$1@dont-email.me>
<20240409181252.0000479f@yahoo.com> <uv5bbr$pndc$1@dont-email.me>
<20240411000737.000038e8@yahoo.com> <uv854o$1j1af$1@dont-email.me>
<9fdc553c8f60c42697bb2de21dedfc0ec8ef718b.camel@gmail.com>
<20240411161308.00006542@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Apr 2024 17:18:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3af0dab980a8d85e0a3db0bdf2631539";
logging-data="1853169"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187KpK2muKCU+yKckwumstKJ7IYWQ0VCGo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:yFmsRrhlAY/cdqYnzQ4SGPjieQ4=
Content-Language: en-US
In-Reply-To: <20240411161308.00006542@yahoo.com>
 by: Paavo Helde - Thu, 11 Apr 2024 15:18 UTC

11.04.2024 16:13 Michael S kirjutas:

> I can not see a single reason to use std::list. It brings nothing to the
> table relatively to my own lists and just reduces flexibility and
> transparency.

You are right, but for wrong reasons. There is usually little reason to
use std::list because std::vector or std::deque is almost always a
better choice.

std::list might be occasionally useful for holding a bunch of entity
objects whose addresses must remain unchanged.


devel / comp.lang.c++ / Re: std::map advocacy

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor