diff options
author | John Hodge <tpg@mutabah.net> | 2015-03-31 14:20:18 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-03-31 14:20:18 +0800 |
commit | f725889aedd5b64141e8f8e9924e4e59f716c225 (patch) | |
tree | 7a132887475f67c26478b3c4738e1646652e169e /src/types.hpp | |
parent | f5819ef88927734bcc36769b50d1b69de377b5db (diff) | |
download | mrust-f725889aedd5b64141e8f8e9924e4e59f716c225.tar.gz |
Partial comparisons of types/paths to speed up impl searches
Diffstat (limited to 'src/types.hpp')
-rw-r--r-- | src/types.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types.hpp b/src/types.hpp index 38f2b26b..443f9912 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -188,6 +188,9 @@ public: void add_trait(TypeRef trait) { assert(is_wildcard()); m_inner_types.push_back( ::std::move(trait) ); }
const ::std::vector<TypeRef>& traits() const { assert(is_wildcard()); return m_inner_types; }
+ /// Returns 0 if types are identical, 1 if TypeRef::TagArg is present in one, and -1 if form differs
+ int equal_no_generic(const TypeRef& x) const;
+
Ordering ord(const TypeRef& x) const;
bool operator==(const TypeRef& x) const { return ord(x) == OrdEqual; }
bool operator!=(const TypeRef& x) const { return ord(x) != OrdEqual; }
|