Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 818 Bytes

c26476.md

File metadata and controls

24 lines (18 loc) · 818 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid author ms.author ms.custom
Learn more about the C26476 USE_VARIANT C++ Core Guidelines Checker warning. Use a type-safe alternative to union, which is preferred in modern code.
Warning C26476
04/29/2022
C26476
USE_VARIANT
C26476
bb2b3b26-9a84-4d81-8bae-ad9a5577c8a6
kylereedmsft
kylereed
kr2b-contr-experiment

Warning C26476

Expression/symbol 'name' uses a naked union 'union' with multiple type pointers: Use variant instead (type.7)

Remarks

std::variant provides a type-safe alternative to union and should be preferred in modern code.

Code analysis name: USE_VARIANT

See also

C++ Core Guideline C.181