Is there a constexpr in new standard C11 (not C++11) or planned in the future?

StackOverflow https://stackoverflow.com/questions/18032334

  •  23-06-2022
  •  | 
  •  

سؤال

In the new language standard C++11 is present the keyword constexpr.

Is there a constexpr in new standard C11 (not C++11) or planned in the future?

هل كانت مفيدة؟

المحلول

No, there is not a constexpr or similar usage keyword in C11. As to if it is planned in the future, the answer is "I don't know".

C11 §6.6 Constant expressions gives the constrains on constant expression:

Constant expressions shall not contain assignment, increment, decrement, function-call, or comma operators, except when they are contained within a subexpression that is not evaluated.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top