Assume the following code:
#include <iostream> #include <vector> #include <string> int main() { std::vector<std::string> lines; lines.push_back("line"); for (const auto& s : lines) { std::cout << s; } }
The following warning appears in the for loop line:
C26493 Do not use C-style casts that will execute static_cast downcast, const_cast, or reinterpret_cast.
Can someone explain where this comes from? Im using Visual Studio 2017 Community Edition version 15.2.
c ++ c ++ 11 static-analysis cpp-core-guidelines
Maximilian
source share