नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'function' : call does not result in a constant expression
Remarks
A function declared as constexpr can only call other functions declared as constexpr.
Example
The following example generates C2134:
// C2134.cpp
// compile with: /c
int A() {
return 42;
}
constexpr int B() {
return A(); // Error C2134: 'A': call does not result in a constant expression.
}
Possible resolution:
// C2134b.cpp
constexpr int A() { // add constexpr to A, since it meets the requirements of constexpr.
return 42;
}
constexpr int B() {
return A(); // No error
}