Reputation: 5805
We try to clean up our project and remove all warnings. I get warning for this line:
if(line.find_first_not_of('\n\t ') != string::npos) {
warning C4305: 'argument' : truncation from 'int' to 'char'
I am not sure what to do... Both values are size_t, not sure why it complains.
Upvotes: 3
Views: 2532
Reputation: 361254
The warning is misleading. It should rather warn about multi-character to char conversion, as you're using '\n\t'
(which is multi-character) instead of "\n\t"
(which is a string).
Anyway, you need to use double quotes here:
if(line.find_first_not_of("\n\t ") != string::npos)
Hope that helps.
Upvotes: 13