match should be a const method.
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index 2886d1a..bb2b144 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -231,7 +231,7 @@
return result.str();
}
-bool Name::match(const Name &name)
+bool Name::match(const Name &name) const
{
// Imitate ndn_Name_match.
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index e64d29d..dc59f06 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -181,7 +181,7 @@
* @param name The Name to check.
* @return true if this matches the given name, otherwise false. This always returns true if this name is empty.
*/
- bool match(const Name &name);
+ bool match(const Name &name) const;
/**
* Write the value to result, escaping characters according to the NDN URI Scheme.