From 34feedf82f2e15febd5fa19e88028f6051fd0a5f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 4 Feb 2016 22:52:01 +0100 Subject: [PATCH] sanity: should have defined those operators inline ...this was clearly wrong; it went unnoticed just because the linker cleans up duplicates of template instantiations. (I'd expect GCC-5 to spot such errors) --- src/lib/iter-adapter.hpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lib/iter-adapter.hpp b/src/lib/iter-adapter.hpp index 4f1f0ed1e..96c92345c 100644 --- a/src/lib/iter-adapter.hpp +++ b/src/lib/iter-adapter.hpp @@ -262,10 +262,10 @@ namespace lib { /// Supporting equality comparisons... template - bool operator== (IterAdapter const& il, IterAdapter const& ir) { return il.pos_ == ir.pos_; } + inline bool operator== (IterAdapter const& il, IterAdapter const& ir) { return il.pos_ == ir.pos_; } template - bool operator!= (IterAdapter const& il, IterAdapter const& ir) { return !(il == ir); } + inline bool operator!= (IterAdapter const& il, IterAdapter const& ir) { return !(il == ir); } @@ -390,14 +390,16 @@ namespace lib { /// Supporting equality comparisons of equivalent iterators (same state type)... template - bool operator== (IterStateWrapper const& il, IterStateWrapper const& ir) + inline bool + operator== (IterStateWrapper const& il, IterStateWrapper const& ir) { return (il.empty() && ir.empty()) || (il.isValid() && ir.isValid() && il.core_ == ir.core_); } template - bool operator!= (IterStateWrapper const& il, IterStateWrapper const& ir) + inline bool + operator!= (IterStateWrapper const& il, IterStateWrapper const& ir) { return not (il == ir); } @@ -510,10 +512,10 @@ namespace lib { /// Supporting equality comparisons... template - bool operator== (RangeIter const& il, RangeIter const& ir) { return (!il && !ir) || (il.getPos() == ir.getPos()); } + inline bool operator== (RangeIter const& il, RangeIter const& ir) { return (!il && !ir) || (il.getPos() == ir.getPos()); } template - bool operator!= (RangeIter const& il, RangeIter const& ir) { return !(il == ir); } + inline bool operator!= (RangeIter const& il, RangeIter const& ir) { return !(il == ir); } @@ -617,10 +619,10 @@ namespace lib { /// Supporting equality comparisons... template - bool operator== (NumIter const& il, NumIter const& ir) { return (!il && !ir) || (il.getPos() == ir.getPos()); } + inline bool operator== (NumIter const& il, NumIter const& ir) { return (!il && !ir) || (il.getPos() == ir.getPos()); } template - bool operator!= (NumIter const& il, NumIter const& ir) { return !(il == ir); } + inline bool operator!= (NumIter const& il, NumIter const& ir) { return !(il == ir); } @@ -737,10 +739,10 @@ namespace lib { /// Supporting equality comparisons... template - bool operator== (ConstIter const& il, ConstIter const& ir) { return il.getBase() == ir.getBase(); } + inline bool operator== (ConstIter const& il, ConstIter const& ir) { return il.getBase() == ir.getBase(); } template - bool operator!= (ConstIter const& il, ConstIter const& ir) { return not (il == ir); } + inline bool operator!= (ConstIter const& il, ConstIter const& ir) { return not (il == ir); }