I noticed that many Poco classes have a protected destructor. This makes them more annoying for coding. For example, here are some of my codes:
struct W2: Poco::Util::WinRegistryConfiguration { typedef Poco::Util::WinRegistryConfiguration inherited; using inherited::inherited; }; std::string get_documents_folder() { W2 regc { "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" }; return regc.getString("Personal", ""); }
Of course, it would be much easier if I could do away with W2 and just make regc be of type WinRegistryConfiguration . But this is not possible due to the protected destructor.
I understand that you can use Poco::AutoPtr , but then the resource is lost, making dynamic allocation with new , when automatic allocation should work fine.
My question is: what is the reason for this and I donβt notice anything?
source share