Ambiguous overload for 'operator[]'
Created by: zgoda
I revisited my old code written against 5.6.x and found that in 5.8.1 I'm no longer allowed to use char[]
variable as object key:
src/process.cpp: In member function 'bool ProcessManager::_loadConfig()':
src/process.cpp:38:33: error: ambiguous overload for 'operator[]' (operand types are 'ArduinoJson::JsonObject' and 'char [21]')
JsonArray& statesList = root[rootKeyBuf];
rootKeyBuf
is regular C string variable so I can do sprintf()
on it. It works if I cast it to const char *
:
JsonArray& statesList = root[(const char *)rootKeyBuf];
Was that intentional?