From 491cad95deaf8822d47d37b77982fa7a9de6e2a7 Mon Sep 17 00:00:00 2001 From: RonxBulld <526677628@qq.com> Date: Mon, 26 Apr 2021 15:05:25 +0800 Subject: [PATCH] Add virtual destructors to Option and Options. Option member is set to protected mode. --- include/cxxopts.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 694a2b5..fd4f4e6 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1575,6 +1575,8 @@ namespace cxxopts { } + virtual ~Option() = default; + std::string opts_; std::string desc_; std::shared_ptr value_; @@ -1656,6 +1658,8 @@ namespace cxxopts { } + virtual ~Options() = default; + Options& positional_help(std::string help_text) { @@ -1776,6 +1780,8 @@ namespace cxxopts void generate_all_groups_help(String& result) const; + protected: + std::string m_program{}; String m_help_string{}; std::string m_custom_help{};