Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 725 Bytes

misc-string-integer-assignment.rst

File metadata and controls

31 lines (23 loc) · 725 Bytes

misc-string-integer-assignment

The check finds assignments of an integer to std::basic_string<CharT> (std::string, std::wstring, etc.). The source of the problem is the following assignment operator of std::basic_string<CharT>:

Numeric types can be implicity casted to character types.

Use the appropriate conversion functions or character literals.

In order to suppress false positives, use an explicit cast.