Tidy up some operators, made possible by the previous-but-one commit.
[libdcp.git] / src / language_tag.h
index 1c7faa443f562d78426e43512e28f26861d98fc9..6f46c16bcadac3780e469b4fe99ad8a19f33cd97 100644 (file)
@@ -71,6 +71,10 @@ public:
                bool operator== (SubtagData const& other) const {
                        return subtag == other.subtag && description == other.description;
                }
+
+               bool operator!=(SubtagData const& other) const {
+                       return subtag != other.subtag || description != other.description;
+               }
        };
 
        enum class SubtagType
@@ -97,6 +101,14 @@ public:
                        return _subtag == other._subtag;
                }
 
+               bool operator!=(Subtag const& other) const {
+                       return _subtag != other._subtag;
+               }
+
+               bool operator<(Subtag const& other) const {
+                       return _subtag < other._subtag;
+               }
+
        protected:
                Subtag (std::string subtag, SubtagType type);
 
@@ -154,9 +166,6 @@ public:
                SubtagType type () const override {
                        return SubtagType::VARIANT;
                }
-
-               bool operator== (VariantSubtag const& other) const;
-               bool operator< (VariantSubtag const& other) const;
        };
 
 
@@ -171,9 +180,6 @@ public:
                SubtagType type () const override {
                        return SubtagType::EXTLANG;
                }
-
-               bool operator== (ExtlangSubtag const& other) const;
-               bool operator< (ExtlangSubtag const& other) const;
        };
 
        LanguageTag () {}