From 4bcac2677119f800a9692bd65366417fe409735e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Apr 2016 08:31:41 +0200 Subject: Add support for printing overrides in dump() --- build2/variable | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'build2/variable') diff --git a/build2/variable b/build2/variable index 10a0f59..8f0969a 100644 --- a/build2/variable +++ b/build2/variable @@ -271,6 +271,20 @@ namespace build2 lookup (const value_type& v, const T& x): lookup (&v, &x.vars) {} }; + // Two lookups are equal if they point to the same variable. + // + inline bool + operator== (const lookup& x, const lookup& y) + { + bool r (x.value == y.value); + assert (!r || x.vars == y.vars); + return r; + } + + inline bool + operator!= (const lookup& x, const lookup& y) {return !(x == y);} + + // Representation types. // // Potential optimizations: -- cgit v1.1