From b3c9933350e5c6b9d06a72034e681cecae52dc4b Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 16 Jul 2020 19:55:15 +1000 Subject: Add constexpr, const, noexcept and make other small improvements to lexlib. --- lexlib/OptionSet.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lexlib/OptionSet.h') diff --git a/lexlib/OptionSet.h b/lexlib/OptionSet.h index 918eaba4f..3c282e49b 100644 --- a/lexlib/OptionSet.h +++ b/lexlib/OptionSet.h @@ -68,7 +68,7 @@ class OptionSet { } return false; } - const char *Get() const { + const char *Get() const noexcept { return value.c_str(); } }; @@ -83,8 +83,6 @@ class OptionSet { names += name; } public: - virtual ~OptionSet() { - } void DefineProperty(const char *name, plcob pb, std::string description="") { nameToDef[name] = Option(pb, description); AppendName(name); @@ -97,7 +95,7 @@ public: nameToDef[name] = Option(ps, description); AppendName(name); } - const char *PropertyNames() const { + const char *PropertyNames() const noexcept { return names.c_str(); } int PropertyType(const char *name) { @@ -141,7 +139,7 @@ public: } } - const char *DescribeWordListSets() const { + const char *DescribeWordListSets() const noexcept { return wordLists.c_str(); } }; -- cgit v1.2.3