From 9d19e091feb8b9e79747378cadf50bb677219656 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Fri, 18 Sep 2015 20:45:00 +0100 Subject: [PATCH] refs #467 Added CIdentifierList::containsAnyNotIn(). --- src/blackmisc/identifierlist.cpp | 5 +++++ src/blackmisc/identifierlist.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/blackmisc/identifierlist.cpp b/src/blackmisc/identifierlist.cpp index 984151a44..8a345b236 100644 --- a/src/blackmisc/identifierlist.cpp +++ b/src/blackmisc/identifierlist.cpp @@ -17,4 +17,9 @@ namespace BlackMisc CIdentifierList::CIdentifierList(const CSequence &other) : CSequence(other) { } + + bool CIdentifierList::containsAnyNotIn(const CIdentifierList &other) const + { + return containsBy([&other](const CIdentifier &id) { return ! other.contains(id); }); + } } // namespace diff --git a/src/blackmisc/identifierlist.h b/src/blackmisc/identifierlist.h index 3984fd00c..1ab02a28e 100644 --- a/src/blackmisc/identifierlist.h +++ b/src/blackmisc/identifierlist.h @@ -36,6 +36,9 @@ namespace BlackMisc //! Construct from a base class object. CIdentifierList(const CSequence &other); + + //! This list contains an identifier which is not contained in other. + bool containsAnyNotIn(const CIdentifierList &other) const; }; } //namespace