This turned out to be fairly straightforward; I iterate over all the clang::FunctionDecls in the current translation unit and ask if they can be evaluated in a constexpr context with clang::Sema::CheckConstexprFunctionDecl, clang::Sema::CheckConstexprFunctionBody, and clang::Sema::CheckConstex...
For integral types you can always define them as const static members as in struct Example { const static int name = 123; // added 'static' to code in text of question const static unsigned usPerSec = 1000000; }; For non-integral types, such as double in your example, the situation...
Expand All @@ -53,7 +53,7 @@ type cdiHandler struct { var _ Interface = &cdiHandler{} // newHandler constructs a new instance of the 'cdi' interface // newHandler constructs a new instance of the 'cdi' interface. func newHandler(opts ...Option) (Interface, error) { c := &cdi...