News for hackers. Stuff that matters.
Re:The data-oriented design process for game development by jcelerier on Friday May 27, 2022 @12:05PM (#31531200)
The dependency on boost is not mandatory:

- Either you can use standalone PFR (it does not really change anything as it's almost exactly the same code, just outside of namespace boost) but apparently that is an issue ahah

- Or you can lobby the committee to accept P1061 ; there's already a compiler implementation based on clang-12: https://github.com/ricejasonf/llvm-project/tree/ricejasonf/p...

With it, the code becomes even simpler and would not need PFR at all ; a function such as

    std::size_t create()
    {
      [&]<std::size_t... N>(std::index_sequence<N...>)
      {
        (std::get<N>(vec).push_back({}), ...);
      }
      (indices{});

      return size() - 1;
    }
just becomes

    std::size_t create()
    {
      auto& [... v] = vec;
      ((v.push_back({}), ...);

      return size() - 1;
    }

There are no comments on this comment yet.