Add introduction

This commit is contained in:
Loïc Joly 2024-12-19 16:45:31 +01:00
parent 3e8152b698
commit f376942ba0

View File

@ -1,3 +1,4 @@
This rule raises an issue when `std::optional`, `boost::optional`, or `std::expected` wrap a basic type, and a conversion from the wrapper type to `bool` is used to test the presence of a contained value.
== Why is this an issue?
@ -13,7 +14,7 @@ if(flag.has_value()) { ... }
When the contained type is also convertible to `bool`, using this concise syntax can be confusing. What is tested: The wrapper, or the contained value?
This rule raises an issue when `std::optional`, `boost::optional`, or `std::expected` wrap a basic type, and the conversion to `bool` is used to test presence of the value.
This rule raises an issue when `std::optional`, `boost::optional`, or `std::expected` wrap a basic type, and the conversion to `bool` is used to test the presence of the value.
=== What is the potential impact?