プログラミング言語C++標準規格に潜む恐竜たち。🦕🦖
C++20(N4861) D.5 Deprecated volatile
typesより引用。*1
1 Postfix
++
and--
expressions (7.6.1.5) and prefix++
and--
expressions (7.6.2.2) of volatile-qualified arithmetic and pointer types are deprecated.volatile int velociraptor; ++velociraptor; // deprecated2 Certain assignments where the left operand is a volatile-qualified non-class type are deprecated; see 7.6.19.
int neck, tail; volatile int brachiosaur; brachiosaur = neck; // OK tail = brachiosaur; // OK tail = brachiosaur = neck; // deprecated brachiosaur += neck; // deprecated brachiosaur = brachiosaur + neck; // OK3 A function type (9.3.3.5) with a parameter with volatile-qualified type or with a volatile-qualified return type is deprecated.
volatile struct amber jurassic(); // deprecated void trex(volatile short left_arm, volatile short right_arm); // deprecated void fly(volatile struct pterosaur* pteranodon); // OK4 A structured binding (9.6) of a volatile-qualified type is deprecated.
struct linhenykus { short forelimb; }; void park(linhenykus alvarezsauroid) { volatile auto [what_is_this] = alvarezsauroid; // deprecated // ... }
メモ:
- velociraptor = ヴェロキラプトル
- brachiosaur = ブラキオサウルス
- amber = 琥珀 / jurassic = ジュラ紀
- trex = ティラノサウルス
- pterosaur = 翼竜 / pteranodon = プテラノドン
- linhenykus = リンヘニクス / forelimb = 前肢
- alvarezsauroid = アルヴァレスサウルス上科
おまけ:
関連URL