On 13.06.20 21:11, Andrei Alexandrescu wrote:
https://github.com/ZigaSajovic/optimizing-the-memory-layout-of-std-tuple

Would be interesting to adapt it for std.tuple.


That's likely to run into the following arbitrary language limitation:

---
alias Seq(T...)=T;
struct T{
    int a,b;
    alias expand=Seq!(b,a);
}
void main(){
    import std.stdio;
    writeln(T(1,2).expand);
}
---
Error: need `this` for `b` of type `int`
Error: need `this` for `a` of type `int`
---

Another question is if automatic packing is worth making the layout harder to predict.
  • Interesting work on packing... Andrei Alexandrescu via Digitalmars-d-announce
    • Re: Interesting work o... user1234 via Digitalmars-d-announce
    • Re: Interesting work o... Timon Gehr via Digitalmars-d-announce
      • Re: Interesting wo... Andrei Alexandrescu via Digitalmars-d-announce
        • Re: Interestin... Avrina via Digitalmars-d-announce
          • Re: Intere... Andrei Alexandrescu via Digitalmars-d-announce
            • Re: I... Avrina via Digitalmars-d-announce
              • R... Paul Backus via Digitalmars-d-announce
                • ... Timon Gehr via Digitalmars-d-announce
                • ... Andrei Alexandrescu via Digitalmars-d-announce
                • ... Max Samukha via Digitalmars-d-announce
                • ... Andrej Mitrovic via Digitalmars-d-announce
                • ... Max Samukha via Digitalmars-d-announce

Reply via email to