Init
This commit is contained in:
18
cppdraft/depr/static/constexpr.md
Normal file
18
cppdraft/depr/static/constexpr.md
Normal file
@@ -0,0 +1,18 @@
|
||||
[depr.static.constexpr]
|
||||
|
||||
# Annex D (normative) Compatibility features [[depr]](./#depr)
|
||||
|
||||
## D.7 Redeclaration of static constexpr data members [depr.static.constexpr]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/future.tex#L148)
|
||||
|
||||
For compatibility with prior revisions of C++, a constexpr static data member may be redundantly redeclared outside the class with no
|
||||
initializer ([[basic.def]](basic.def "6.2 Declarations and definitions"), [[class.static.data]](class.static.data "11.4.9.3 Static data members"))[.](#1.sentence-1)
|
||||
|
||||
This usage is deprecated[.](#1.sentence-2)
|
||||
|
||||
[*Example [1](#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*]
|
||||
Reference in New Issue
Block a user