{"action":"created","issue":{"url":"https://api.github.com/repos/hyperrealm/libconfig/issues/41","labels_url":"https://api.github.com/repos/hyperrealm/libconfig/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/hyperrealm/libconfig/issues/41/comments","events_url":"https://api.github.com/repos/hyperrealm/libconfig/issues/41/events","html_url":"https://github.com/hyperrealm/libconfig/issues/41","id":122958108,"number":41,"title":"Removing a libconfig::Setting removes sibling","user":{"login":"random85","id":2323410,"avatar_url":"https://avatars.githubusercontent.com/u/2323410?v=3","gravatar_id":"","url":"https://api.github.com/users/random85","html_url":"https://github.com/random85","followers_url":"https://api.github.com/users/random85/followers","following_url":"https://api.github.com/users/random85/following{/other_user}","gists_url":"https://api.github.com/users/random85/gists{/gist_id}","starred_url":"https://api.github.com/users/random85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/random85/subscriptions","organizations_url":"https://api.github.com/users/random85/orgs","repos_url":"https://api.github.com/users/random85/repos","events_url":"https://api.github.com/users/random85/events{/privacy}","received_events_url":"https://api.github.com/users/random85/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-18T14:29:51Z","updated_at":"2015-12-18T20:13:20Z","closed_at":null,"body":"I'm trying to overwrite a setting that can be from another type of the original. To do that, I first try to remove the existing and add a new one using the new type. However, when I remove a setting, all the siblings are removed as well.\r\n\r\nThis small test program:\r\n```cpp\r\n#include <string>\r\n#include <iostream>\r\n\r\n#include <libconfig.h++>\r\n\r\nint main(int argc, char* argv[])\r\n{\r\n\tstd::string szConfig  = \"a:{b:3;c:4;}\";\r\n\tlibconfig::Config libConfig;\r\n\t\r\n\ttry\r\n\t{\r\n\t\tlibConfig.readString(szConfig);\r\n\t\tlibConfig.getRoot().remove(\"a.b\");\r\n\t\tlibConfig.writeFile(\"/tmp/testconfig.cfg\");\r\n\t\tlibConfig.lookup(\"a.c\");  //<--- SettingNotFoundException\r\n\t}\r\n\tcatch(std::exception const& ex)\r\n\t{\r\n\t\tstd::cerr << ex.what() << std::endl;\r\n\t\treturn -1;\r\n\t}\r\n\t\r\n\treturn 0;\r\n}\r\n```\r\n\r\nGives me the following output:\r\n```\r\nSettingNotFoundException\r\n```\r\n\r\nIs that an expected behavior? IMHO, no, if I trust the documentation \"a.b\" is not a group and a SettingTypeException shall be thrown... But that is not the case! The created file is empty!"},"comment":{"url":"https://api.github.com/repos/hyperrealm/libconfig/issues/comments/165888312","html_url":"https://github.com/hyperrealm/libconfig/issues/41#issuecomment-165888312","issue_url":"https://api.github.com/repos/hyperrealm/libconfig/issues/41","id":165888312,"user":{"login":"hyperrealm","id":2344483,"avatar_url":"https://avatars.githubusercontent.com/u/2344483?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperrealm","html_url":"https://github.com/hyperrealm","followers_url":"https://api.github.com/users/hyperrealm/followers","following_url":"https://api.github.com/users/hyperrealm/following{/other_user}","gists_url":"https://api.github.com/users/hyperrealm/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperrealm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperrealm/subscriptions","organizations_url":"https://api.github.com/users/hyperrealm/orgs","repos_url":"https://api.github.com/users/hyperrealm/repos","events_url":"https://api.github.com/users/hyperrealm/events{/privacy}","received_events_url":"https://api.github.com/users/hyperrealm/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T20:13:20Z","updated_at":"2015-12-18T20:13:20Z","body":"There is no \"ab\" or \"ac\". You can reference \"a.b\" or \"a.c\", but remove does not support paths. My guess is the exception is being thrown by the remove call, not the lookup call."}}