Date: Sat, 15 Mar 2025 08:24:28 +0000
Are you sure "introduce a view, adding a boolean (still present) a list (tree) of pseudo removed objects" will it be as fast and clear as pseudo const ? what about memory usage ?
________________________________
De : Std-Proposals <std-proposals-bounces_at_[hidden]> de la part de Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]>
Envoyé : jeudi 13 mars 2025 14:14
Ŕ : std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc : Sebastian Wittmeier <wittmeier_at_[hidden]>
Objet : Re: [std-proposals] Pseudo const answer
You could introduce a view that stores either a boolean (still present) or a list (tree) of pseudo-removed objects.
This specific view provides the option for pseudo-removal, searching the top, etc.
As long as the underlying container is not changed, the view should be able to stably perform all those operations.
-----Ursprüngliche Nachricht-----
Von: Jerome Saint-Martin via Std-Proposals <std-proposals_at_[hidden]>
Gesendet: Do 13.03.2025 14:32
Betreff: [std-proposals] Pseudo const answer
An: std-proposals_at_[hidden];
CC: Jerome Saint-Martin <jerome.saint-martin_at_[hidden]>;
Hello,
I wanted to answer a question about my proposal for pseudoconstness
, posted in february 2018, with jsaintmartin356_at_[hidden], to :
[gasper..._at_[hidden]'s profile photo]
gasper..._at_[hidden]
but the site changed. So I created a new account with this mail adress.
The question was :
"
...
I'm misunderstanding something and you want to provide both a const and a pseudoconst method on the same class, in which case, please elucidate why that would ever be useful, because I truly cannot think of an example.
"
and answer :
"
Pseudo Const can be useful in this example :
"
Your are a university director and want to know the best ten students (the "top"). To do this you may sort all the results, and keep the ten best, but this causes tons of useless comparisons. The solution for me is a pseudo const function member :a loop of 10 iterations : "find the best result, remove if from the results", and reinsert the top ten student in the container.
As student result shall not be erased, the pseudo constness of the member function guaranties no result were erased
"
________________________________
De : Std-Proposals <std-proposals-bounces_at_[hidden]> de la part de Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]>
Envoyé : jeudi 13 mars 2025 14:14
Ŕ : std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc : Sebastian Wittmeier <wittmeier_at_[hidden]>
Objet : Re: [std-proposals] Pseudo const answer
You could introduce a view that stores either a boolean (still present) or a list (tree) of pseudo-removed objects.
This specific view provides the option for pseudo-removal, searching the top, etc.
As long as the underlying container is not changed, the view should be able to stably perform all those operations.
-----Ursprüngliche Nachricht-----
Von: Jerome Saint-Martin via Std-Proposals <std-proposals_at_[hidden]>
Gesendet: Do 13.03.2025 14:32
Betreff: [std-proposals] Pseudo const answer
An: std-proposals_at_[hidden];
CC: Jerome Saint-Martin <jerome.saint-martin_at_[hidden]>;
Hello,
I wanted to answer a question about my proposal for pseudoconstness
, posted in february 2018, with jsaintmartin356_at_[hidden], to :
[gasper..._at_[hidden]'s profile photo]
gasper..._at_[hidden]
but the site changed. So I created a new account with this mail adress.
The question was :
"
...
I'm misunderstanding something and you want to provide both a const and a pseudoconst method on the same class, in which case, please elucidate why that would ever be useful, because I truly cannot think of an example.
"
and answer :
"
Pseudo Const can be useful in this example :
"
Your are a university director and want to know the best ten students (the "top"). To do this you may sort all the results, and keep the ten best, but this causes tons of useless comparisons. The solution for me is a pseudo const function member :a loop of 10 iterations : "find the best result, remove if from the results", and reinsert the top ten student in the container.
As student result shall not be erased, the pseudo constness of the member function guaranties no result were erased
"
-- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-03-15 08:24:31