回答編集履歴

1

refine

2020/08/13 09:04

投稿

yohhoy
yohhoy

スコア6191

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  ----
10
10
 
11
- 本題から外れますが、質問中にある実装では常に`uint8_t`に評価されます。式`static_cast<uint8_t>(obj) <= Uint8Max`は常に`true`です。
11
+ 本題から外れますが、質問の関数実装では常に`uint8_t`を返します。式`static_cast<uint8_t>(obj) <= Uint8Max`は常に`true`です。
12
12
 
13
13
 
14
14
 
@@ -16,8 +16,6 @@
16
16
 
17
17
  constexpr auto Uint8Max = std::numeric_limits<uint8_t>::max();
18
18
 
19
-
20
-
21
19
  if constexpr (static_cast<uint8_t>(obj) <= Uint8Max) return (uint8_t{});
22
20
 
23
21
  ```