From Jason Turner

[depr.volatile.type]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpg4b2azii/{from.md → to.md} +60 -0
tmp/tmpg4b2azii/{from.md → to.md} RENAMED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Deprecated `volatile` types <a id="depr.volatile.type">[[depr.volatile.type]]</a>
2
+
3
+ Postfix `++` and `\dcr` expressions [[expr.post.incr]] and prefix `++`
4
+ and `\dcr` expressions [[expr.pre.incr]] of volatile-qualified
5
+ arithmetic and pointer types are deprecated.
6
+
7
+ [*Example 1*:
8
+
9
+ ``` cpp
10
+ volatile int velociraptor;
11
+ ++velociraptor; // deprecated
12
+ ```
13
+
14
+ — *end example*]
15
+
16
+ Certain assignments where the left operand is a volatile-qualified
17
+ non-class type are deprecated; see  [[expr.ass]].
18
+
19
+ [*Example 2*:
20
+
21
+ ``` cpp
22
+ int neck, tail;
23
+ volatile int brachiosaur;
24
+ brachiosaur = neck; // OK
25
+ tail = brachiosaur; // OK
26
+ tail = brachiosaur = neck; // deprecated
27
+ brachiosaur += neck; // deprecated
28
+ brachiosaur = brachiosaur + neck; // OK
29
+ ```
30
+
31
+ — *end example*]
32
+
33
+ A function type [[dcl.fct]] with a parameter with volatile-qualified
34
+ type or with a volatile-qualified return type is deprecated.
35
+
36
+ [*Example 3*:
37
+
38
+ ``` cpp
39
+ volatile struct amber jurassic(); // deprecated
40
+ void trex(volatile short left_arm, volatile short right_arm); // deprecated
41
+ void fly(volatile struct pterosaur* pteranodon); // OK
42
+ ```
43
+
44
+ — *end example*]
45
+
46
+ A structured binding [[dcl.struct.bind]] of a volatile-qualified type is
47
+ deprecated.
48
+
49
+ [*Example 4*:
50
+
51
+ ``` cpp
52
+ struct linhenykus { short forelimb; };
53
+ void park(linhenykus alvarezsauroid) {
54
+ volatile auto [what_is_this] = alvarezsauroid; // deprecated
55
+ // ...
56
+ }
57
+ ```
58
+
59
+ — *end example*]
60
+