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;
}
}
At the line of the for loop I get the following warning:
C26493 Don't use C-style casts that would perform a static_cast downcast, const_cast, or reinterpret_cast.
Can someone explain where this is coming from? Im using Visual Studio 2017 Community Edition Version 15.2.
As seen in this bug report it seems to happen only for the std::string
type when inserting into a basic_iostream
. This bug has been resolved but hasn't been released yet so for now you'll just have to wait.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With