// declare the private member variable
libconfig::Setting setting;
// in constructor, setup it
const libconfig::Setting& root = cfg.getRoot();
setting = root["x"]["y"]; //operator= is inaccessible
and also:
// declare the private member variable
libconfig::Setting* setting;
// in constructor, setup it
const libconfig::Setting& root = cfg.getRoot();
setting = new libconfig::Setting(root["x"]["y"]); // Setting(const Setting& other) is inaccessible
Both method fail, so how do I use libconfig::Setting as a member variable?
The Setting object is not meant to be used that way. You should copy the value of the setting into a variable of the appropriate type, and use that as your member variable.
I've tried:
and also:
Both method fail, so how do I use libconfig::Setting as a member variable?