On Monday, 11 January 2021 at 09:42:39 UTC, Ola Fosheim Grøstad wrote:
I though maybe it would be nice in general to be able to create static indexed type by having a special field name pattern, but I will have a another look at staticMap (I don't really want the full staticMap into object.d though).

This is the core of staticMap, I find it problematic to do this kind of string mixin in object.d:

private enum staticMapExpandFactor = 150;
private string generateCases()
{
    string[staticMapExpandFactor] chunks;
    chunks[0] = q{};
    static foreach (enum i; 0 .. staticMapExpandFactor - 1)
chunks[i + 1] = chunks[i] ~ `F!(Args[` ~ i.stringof ~ `]),`;
    string ret = `AliasSeq!(`;
    foreach (chunk; chunks)
        ret ~= `q{alias staticMap = AliasSeq!(` ~ chunk ~ `);},`;
    return ret ~ `)`;
}
private alias staticMapBasicCases = AliasSeq!(mixin(generateCases()));




  • I want to create my own Tuple... Ola Fosheim Grøstad via Digitalmars-d-learn
    • Re: I want to create my ... Paul Backus via Digitalmars-d-learn
      • Re: I want to create... Ola Fosheim Grostad via Digitalmars-d-learn
        • Re: I want to cr... Paul Backus via Digitalmars-d-learn
          • Re: I want t... Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: I w... Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: I w... Paul Backus via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Paul Backus via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Paul Backus via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn

Reply via email to