Commit 1d6d1c97f05e0dc50eefaf3b4d84872f96eed1ac
1 parent
38b4b1be
clean up standard_value class a bit
This removes the `final` on the class, and the `virtual` keyword on the functions that made `final` necessary. They shouldn't have been virtual in the first place since nothing derives from it. This hopefully doesn't reintroduce the non-virtual-destructor warning.
Showing
1 changed file
with
10 additions
and
6 deletions
include/cxxopts.hpp
| ... | ... | @@ -692,7 +692,7 @@ namespace cxxopts |
| 692 | 692 | }; |
| 693 | 693 | |
| 694 | 694 | template <typename T> |
| 695 | - class standard_value final : public Value | |
| 695 | + class standard_value : public Value | |
| 696 | 696 | { |
| 697 | 697 | public: |
| 698 | 698 | standard_value() |
| ... | ... | @@ -742,15 +742,17 @@ namespace cxxopts |
| 742 | 742 | return m_implicit; |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | - virtual std::shared_ptr<Value> | |
| 746 | - default_value(const std::string& value){ | |
| 745 | + std::shared_ptr<Value> | |
| 746 | + default_value(const std::string& value) | |
| 747 | + { | |
| 747 | 748 | m_default = true; |
| 748 | 749 | m_default_value = value; |
| 749 | 750 | return shared_from_this(); |
| 750 | 751 | } |
| 751 | 752 | |
| 752 | - virtual std::shared_ptr<Value> | |
| 753 | - implicit_value(const std::string& value){ | |
| 753 | + std::shared_ptr<Value> | |
| 754 | + implicit_value(const std::string& value) | |
| 755 | + { | |
| 754 | 756 | m_implicit = true; |
| 755 | 757 | m_implicit_value = value; |
| 756 | 758 | return shared_from_this(); |
| ... | ... | @@ -784,9 +786,11 @@ namespace cxxopts |
| 784 | 786 | protected: |
| 785 | 787 | std::shared_ptr<T> m_result; |
| 786 | 788 | T* m_store; |
| 789 | + | |
| 787 | 790 | bool m_default = false; |
| 788 | - std::string m_default_value; | |
| 789 | 791 | bool m_implicit = false; |
| 792 | + | |
| 793 | + std::string m_default_value; | |
| 790 | 794 | std::string m_implicit_value; |
| 791 | 795 | }; |
| 792 | 796 | } | ... | ... |