as<bool>() not working
Created by: Daemach
I'm trying to parse an array of single char strings (because my server is a pita) into a boolean array. The relevant portion looks like this:
"aPortDir":["0","0","1","1","1","1","1","1"]
This code turns them all to 0's
for (int j = 0; j < root["aPortDir"].size(); j++) {
config.aPortDir[j] = root["aPortDir"][j].as<bool>();
}
config struct defines that array as
boolean aPortDir[8] = {false, false, false, false, false, false, false, false};