|
2791 | 2791 | \tcode{thread_local} there is one copy of the data member that is shared by all |
2792 | 2792 | the objects of the class. |
2793 | 2793 |
|
| 2794 | +\pnum |
| 2795 | +A static data member shall not be \tcode{mutable}\iref{dcl.stc}. |
| 2796 | +A static data member shall not be a direct member\iref{class.mem} |
| 2797 | +of an unnamed\iref{class.pre} or local\iref{class.local} class or |
| 2798 | +of a (possibly indirectly) nested class\iref{class.nest} thereof. |
| 2799 | + |
2794 | 2800 | \pnum |
2795 | 2801 | \indextext{initialization!static member}% |
2796 | 2802 | \indextext{definition!static member}% |
|
2858 | 2864 | There is exactly one definition of a static data member |
2859 | 2865 | that is odr-used\iref{basic.def.odr} in a valid program. |
2860 | 2866 | \end{note} |
2861 | | -Unnamed classes and classes contained directly |
2862 | | -or indirectly within unnamed classes shall not contain static |
2863 | | -data members. |
2864 | 2867 |
|
2865 | 2868 | \pnum |
2866 | 2869 | \begin{note} |
2867 | 2870 | Static data members of a class in namespace scope have the linkage of the name of the class\iref{basic.link}. |
2868 | | -A local class cannot have static data members\iref{class.local}. |
2869 | 2871 | \end{note} |
2870 | 2872 |
|
2871 | 2873 | \pnum |
2872 | 2874 | Static data members are initialized and destroyed exactly like |
2873 | 2875 | non-local variables~(\ref{basic.start.static}, \ref{basic.start.dynamic}, |
2874 | 2876 | \ref{basic.start.term}). |
2875 | 2877 |
|
2876 | | -\pnum |
2877 | | -A static data member shall not be |
2878 | | -\tcode{mutable}\iref{dcl.stc}. |
2879 | | - |
2880 | 2878 | \rSec2[class.bit]{Bit-fields}% |
2881 | 2879 | \indextext{bit-field} |
2882 | 2880 |
|
|
3403 | 3401 |
|
3404 | 3402 | \pnum |
3405 | 3403 | \indextext{restriction!static member local class}% |
3406 | | -A local class shall not have static data members. |
| 3404 | +\begin{note} |
| 3405 | +A local class cannot have static data members\iref{class.static.data}. |
| 3406 | +\end{note} |
3407 | 3407 |
|
3408 | 3408 | \rSec1[class.derived]{Derived classes}% |
3409 | 3409 | \indextext{derived class|(} |
|
0 commit comments