Is strlen (__ FILE__) checked at compile time

Is strlen(__FILE__)

compile-time appreciated - if I use a recent compiler (GCC, Clang, MSVC)?

+3


source to share


2 answers


Clang and gcc can both figure this out at compile time thanks to constant bending , but that doesn't apply anywhere in the C ++ Standard.



Usage sizeof

can ensure that this is evaluated at compile time.

+8


source


No, since the strlen parameter is not defined by the standard as a constexpr function



0


source







All Articles