Warum erhöhen sich angekettete Reichweite manchmal die Größe?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Warum erhöhen sich angekettete Reichweite manchmal die Größe?

by Anonymous » 11 Apr 2025, 11:44

Ich habe mit Std :: Ranges :: Views herumgespielt und habe festgestellt, dass jede Kettenansicht größer wird. Für die Ansicht Iteratoren ist dieses Muster einfach, jeder ist immer 8 Byte größer als das zuvor. Aber für Ansichten selbst erhöht die Transformation überhaupt nicht die Größe, während Filter es um einen Betrag erhöht, den ich nicht erkennen kann. Bei MSVC ist dieses Muster etwas anders, aber immer noch unvorhersehbar für mich.#include
#include
#include

int main() {
static constexpr auto printed = [](auto&& v) {
std::cout < /td>
16 < /td>
< /td>
< /td>
< /tr>

filter < /td>
16 < /td>
32 < /td>
16 < /td>
48 < /td>
Transformation < /td>
24 < /td>
8 < /td>
8 < /td>
64 < /td>
32 < /td>
48 < /td>
< /tr>

Transformation < /td>
40 < /td>
64 < /td>
0 < /td>
128 < /td>
filter
48
8

Top