Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • thanks. Just for curiosity what constexpr exactly does here? Does it help the optimization (like to bake the constant template parameters, and optimize out the function pointer? Commented Aug 29, 2019 at 7:26
  • constexpr is for a constant that the compiler can generate at compile time. Ofent (and in this case) compilers will generate the same code with just const, the main difference is that if you mark something as constexpr which the compiler can't generate at compile time it will fail to compile. see stackoverflow.com/questions/14116003/… and stackoverflow.com/questions/42107744/what-is-constexpr-in-c Commented Aug 29, 2019 at 8:28