Date: Sun, 16 Mar 2025 16:53:22 +0100
Il 16/03/25 15:48, Jason McKesson via Std-Discussion ha scritto:
> If that's how [[indeterminate]] is expected to work, if it's something
> that most programmers most of the time won't need to think about, then
> I don't think these disadvantages really apply. That is, it is not up
> to the implementer of any particular class as to whether or not
> [[indeterminate]] is appropriate for the class; it's up to the final
> user of that object on a case-by-case basis. They are the ones looking
> for that performance benefit, so they are the ones who get to say when
> to get it.
Well, there are classes that are entirely made to reap extra performance
benefits; the prime example are the "std::vector<T> with SOO" that exist
in pretty much every codebase. A user chooses those classes instead of
std::vector<T> precisely because they're looking for extra performance.
It's weird to ask them to _also_ annotate such usages with
[[indeterminate]] (... assuming that they're even using such classes
directly. If they're wrapped by another class (class Foo {
SmallBuffer<int> buf; }), then the situation is even clumsier).
--
Giuseppe D'Angelo
> If that's how [[indeterminate]] is expected to work, if it's something
> that most programmers most of the time won't need to think about, then
> I don't think these disadvantages really apply. That is, it is not up
> to the implementer of any particular class as to whether or not
> [[indeterminate]] is appropriate for the class; it's up to the final
> user of that object on a case-by-case basis. They are the ones looking
> for that performance benefit, so they are the ones who get to say when
> to get it.
Well, there are classes that are entirely made to reap extra performance
benefits; the prime example are the "std::vector<T> with SOO" that exist
in pretty much every codebase. A user chooses those classes instead of
std::vector<T> precisely because they're looking for extra performance.
It's weird to ask them to _also_ annotate such usages with
[[indeterminate]] (... assuming that they're even using such classes
directly. If they're wrapped by another class (class Foo {
SmallBuffer<int> buf; }), then the situation is even clumsier).
--
Giuseppe D'Angelo
Received on 2025-03-16 15:53:25