我可以在初始化列表中调用函数吗?请看这段代码:
#include <string>
using namespace std;
class A {
public:
A(string path) : s(cfg.getRoot()) { // before i call getRoot, i need to call cfg.readFile(path.c_str()), is there any methods? (readFile return void)
}
private:
libconfig::Config cfg;
const libconfig::Setting & s; // const &, so initalizer list is the only chance for me to init it
}