Hacker News new | past | comments | ask | show | jobs | submit login

> but with a library like this, it has to make a subroutine call.

I mean, before I wrote my comment I checked and it's `constexpr` all the way down to the add instruction so if it's going to make a call, I'm not seeing it. There is definitely a lot of template machinery, but I can't be the judge of that immediately.

> I personally feel that libraries like this are taking C++ in the wrong direction ("ranges" is another obvious example)

I think you're making an emotional argument based on some preconceived twitter-verse sentiment. I'm in games too (graphics specifically) and people are up and arms about the wrong thing. Maybe there are corner cases that are a bit overly complex, but what's wrong with being able to write `std::sort(container)` instead of `std::sort(container.begin, container.end)`. There may be things we don't like, but I don't think we should resort to hyperbole either.

Incidentally, I wouldn't use this library if only because for what I do, having explicitly sized data types is important.




constexpr functions are not inlined in debug builds. They can't be: the whole point of debug builds is that you can attach a debugger and step through the code.

Illustration, compare the assembly for "foo1" and "foo2": https://godbolt.org/z/t9Zkx-


Ah ok, my mistake, I read "debug" as "-g" not "-O0." I generally run with optimizations on but with symbols.


For what is worth they are optimized out with -Og (if that doesn't count as debug build I don't know what does).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: