This repository was archived by the owner on Oct 2, 2023. It is now read-only.
File tree 5 files changed +1094
-970
lines changed
5 files changed +1094
-970
lines changed Original file line number Diff line number Diff line change 6
6
#include < string_view>
7
7
#include < wordlist_rule.hpp>
8
8
9
- using namespace OS2DSRules ::WordListRule;
10
-
11
9
namespace OS2DSRules {
12
10
13
11
namespace HealthRule {
14
12
15
- class HealthRule final : public WordListRule {
13
+ class HealthRule {
16
14
public:
17
15
HealthRule () noexcept ;
16
+ HealthRule (const HealthRule &) noexcept = default ;
17
+ HealthRule (HealthRule &&) noexcept = default ;
18
18
~HealthRule () noexcept = default ;
19
+
20
+ [[nodiscard]] MatchResults find_matches (const std::string &) const noexcept ;
21
+
22
+ private:
23
+ OS2DSRules::WordListRule::WordListRule rule_;
19
24
};
20
25
} // namespace HealthRule
21
26
} // namespace OS2DSRules
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ namespace OS2DSRules {
13
13
14
14
namespace WordListRule {
15
15
16
+ using Words = std::unordered_set<std::string_view>;
17
+
16
18
class WordListRule {
17
19
public:
18
20
template <typename Iter>
@@ -22,6 +24,7 @@ class WordListRule {
22
24
words_.insert (*iter);
23
25
}
24
26
}
27
+ WordListRule (Words words) noexcept : words_(words) {}
25
28
WordListRule () noexcept = default ;
26
29
WordListRule (const WordListRule &) noexcept = default ;
27
30
WordListRule (WordListRule &&) noexcept = default ;
@@ -30,7 +33,7 @@ class WordListRule {
30
33
[[nodiscard]] MatchResults find_matches (const std::string &) const noexcept ;
31
34
32
35
protected:
33
- std::unordered_set<std::string_view> words_;
36
+ Words words_;
34
37
35
38
private:
36
39
[[nodiscard]] bool contains (const std::string_view) const noexcept ;
You can’t perform that action at this time.
0 commit comments