Closed nickhuangxinyu closed 3 years ago
There isn't an API provided to add an existing Setting to another, because this would allow all kinds of misuse like adding a setting to itself, adding a parent of a setting as its child, and so on, which would cause problems when it came time to deallocate the setting tree.
What you probably want is:
father_config = { @include "/home/work/child.config" father_int = 1; };
I have a config (
"/home/work/father.config"
) looks like:in
/home/work/child.config
:what i want is to get
father_int
fromchild_cfg
, please see the code:I know if the father_int is type int and the key-father_int wont change, i can use:
but i want this can be more flexible, which need to add
libconfig::Setting::TypeGroup
instead oflibconfig::Setting::TypeInt
,Can you help on this?