• trxxruraxvr@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 days ago

    I haven’t kept up to date with C++ development in the last 16 years, I only recognize the first two of those four.

    • Kwdg@discuss.tchncs.deOP
      link
      fedilink
      arrow-up
      0
      ·
      4 days ago

      You can overload the indexing operazor “[]” (std::vector does this for example), and since c++23 this operator can have more than one argument.

      The last one is a constructor call with an overloaded conversion operator. The {} syntax is possible since c++11 I think. The conversion operator was already available before that

      • xthexder@l.sw0.com
        link
        fedilink
        arrow-up
        1
        ·
        4 days ago

        Ah, that’s why… I didn’t think multiple arguments to operator[] was valid, but my brain is still catching up to C++20 features.