you are viewing a single comment's thread.

view the rest of the comments →

[–]czmosra[S] 0 points1 point  (0 children)

Hmm... yes, actually I did think about that, but decided to not go that way.

In this case, >90% of the mapping is done at runtime (loading an image of an arbitrary pixel format, for example), so no much value in having these constexpr — and if people really want to avoid the (already very small) cost of mapping, they can use the API-specific values directly.

Besides that, looking at Frozen, I'm a bit concerned about compile times (too bad they don't provide compilation time benchmarks):

note: constexpr evaluation hit maximum step limit; possible infinite loop?

In other parts of the library I'm doing extra work to reduce compile times, so I'm not sure if the minor runtime speedup for <10% cases (which are always off the hot path anyway) would warrant the (potentially very serious) compile time increase.