interest: Interest::matchesData function

refs #1157

Change-Id: I5b74367cb1afed75728e2d5092ced5d269332f9d
diff --git a/src/encoding/block.hpp b/src/encoding/block.hpp
index 09bc93d..eef9b3d 100644
--- a/src/encoding/block.hpp
+++ b/src/encoding/block.hpp
@@ -248,6 +248,13 @@
   Block
   blockFromValue() const;
 
+public: // EqualityComparable concept
+  bool
+  operator==(const Block& other) const;
+
+  bool
+  operator!=(const Block& other) const;
+
 protected:
   ConstBufferPtr m_buffer;
 
@@ -475,6 +482,18 @@
   return m_subBlocks.size();
 }
 
+inline bool
+Block::operator==(const Block& other) const
+{
+  return (this->size() == other.size()) &&
+         std::equal(this->begin(), this->end(), other.begin());
+}
+
+inline bool
+Block::operator!=(const Block& other) const
+{
+  return !this->operator==(other);
+}
 
 } // ndn