• vrighter
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          that is besides the point. You can still call malloc, it will still return void*, and it would still reqoire casting in c++

    • Subverb@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      3 days ago

      This isn’t malloc though. I have to assume the cast is because the user has experience with the output from an LLM being untrustworthy.

    • addie@feddit.uk
      link
      fedilink
      arrow-up
      11
      arrow-down
      1
      ·
      4 days ago

      True. Although given how easy it is to cast void pointers to the wrong damn thing, it would be nice if you did, makes refactoring much easier. Makes me appreciate std::any all the more.