Files
cppdraft_translate/cppdraft/depr/static/constexpr.md
2025-10-25 03:02:53 +03:00

831 B

[depr.static.constexpr]

Annex D (normative) Compatibility features [depr]

D.7 Redeclaration of static constexpr data members [depr.static.constexpr]

1

#

For compatibility with prior revisions of C++, a constexpr static data member may be redundantly redeclared outside the class with no initializer ([basic.def], [class.static.data]).

This usage is deprecated.

[Example 1: struct A {static constexpr int n = 5; // definition (declaration in C++ 2014)};

constexpr int A::n; // redundant declaration (definition in C++ 2014) — end example]