I don't think there is or will be anything in the standard (as of c++26) allowing you to do that at compile time. Few options remain:
The former is trivial and efficient; the second depends on what you may use, and the latter is many orders of magnitude more difficult...