diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-23 19:16:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-23 19:16:46 +0100 |
| commit | c7208194515e93f85441c76d78d11a47d79b36e1 (patch) | |
| tree | 107d08a12be06e98bf77c21802a30646a7d14ae5 /src | |
| parent | 1deb04653db2074891ca7be9e2165e7ffc776bf6 (diff) | |
Add operator!= and operator< for LanguageTag
Diffstat (limited to 'src')
| -rw-r--r-- | src/language_tag.cc | 14 | ||||
| -rw-r--r-- | src/language_tag.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/language_tag.cc b/src/language_tag.cc index 6c7e6da9..5e2c5a8b 100644 --- a/src/language_tag.cc +++ b/src/language_tag.cc @@ -366,6 +366,20 @@ dcp::operator== (dcp::LanguageTag const& a, dcp::LanguageTag const& b) } +bool +dcp::operator!= (dcp::LanguageTag const& a, dcp::LanguageTag const& b) +{ + return a.to_string() != b.to_string(); +} + + +bool +dcp::operator< (dcp::LanguageTag const& a, dcp::LanguageTag const& b) +{ + return a.to_string() < b.to_string(); +} + + ostream& dcp::operator<< (ostream& os, dcp::LanguageTag const& tag) { diff --git a/src/language_tag.h b/src/language_tag.h index 1716a8db..d18572e4 100644 --- a/src/language_tag.h +++ b/src/language_tag.h @@ -240,6 +240,8 @@ private: extern bool operator==(dcp::LanguageTag const& a, dcp::LanguageTag const& b); +extern bool operator!=(dcp::LanguageTag const& a, dcp::LanguageTag const& b); +extern bool operator<(dcp::LanguageTag const& a, dcp::LanguageTag const& b); extern std::ostream& operator<<(std::ostream& os, dcp::LanguageTag const& tag); |
