Login
You're viewing the discuss.systems public feed.
  • Sep 22, 2026, 1:02 PM

    C++ programming question, godbolt link below. I’m computing std::strings at compile time via nested function calls, and due to the constexpr rules, I can’t leave the result in heap allocated storage. So I’m using a std::array to store the result and I use the size of the computed string to initialise it. Ideally I’d like to put that in a function, but the constexpr rules force me to use a horrid macro. I can’t think any other way to do it.

    godbolt.org/z/bGYoco4dG

    #CPP #cplusplus

    💬 0🔄 1⭐ 1