diff --git a/include/ndnboost/bind/mem_fn_template.hpp b/include/ndnboost/bind/mem_fn_template.hpp
index b26d585..3ea24e7 100644
--- a/include/ndnboost/bind/mem_fn_template.hpp
+++ b/include/ndnboost/bind/mem_fn_template.hpp
@@ -12,13 +12,13 @@
 //  See http://www.boost.org/libs/bind/mem_fn.html for documentation.
 //
 
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
-# define BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#if !defined(NDNBOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+# define NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 #endif
 
 // mf0
 
-template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf0)
+template<class R, class T NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf0)
 {
 public:
 
@@ -27,55 +27,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) ())
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) ())
     F f_;
 
     template<class U> R call(U & u, T const *) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)();
+        NDNBOOST_MEM_FN_RETURN (u.*f_)();
     }
 
     template<class U> R call(U & u, void const *) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf0)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf0)(F f): f_(f) {}
 
     R operator()(T * p) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)();
+        NDNBOOST_MEM_FN_RETURN (p->*f_)();
     }
 
     template<class U> R operator()(U & u) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p);
+        NDNBOOST_MEM_FN_RETURN call(u, p);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p);
+        NDNBOOST_MEM_FN_RETURN call(u, p);
     }
 
 #endif
 
     R operator()(T & t) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)();
+        NDNBOOST_MEM_FN_RETURN (t.*f_)();
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf0) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf0) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf0) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf0) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -83,7 +83,7 @@
 
 // cmf0
 
-template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf0)
+template<class R, class T NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf0)
 {
 public:
 
@@ -92,40 +92,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) () const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) () const)
     F f_;
 
     template<class U> R call(U & u, T const *) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)();
+        NDNBOOST_MEM_FN_RETURN (u.*f_)();
     }
 
     template<class U> R call(U & u, void const *) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf0)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf0)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p);
+        NDNBOOST_MEM_FN_RETURN call(u, p);
     }
 
     R operator()(T const & t) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)();
+        NDNBOOST_MEM_FN_RETURN (t.*f_)();
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf0) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf0) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf0) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf0) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -133,7 +133,7 @@
 
 // mf1
 
-template<class R, class T, class A1 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf1)
+template<class R, class T, class A1 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf1)
 {
 public:
 
@@ -143,55 +143,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1))
     F f_;
 
     template<class U, class B1> R call(U & u, T const *, B1 & b1) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1);
     }
 
     template<class U, class B1> R call(U & u, void const *, B1 & b1) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf1)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf1)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1);
     }
 
     template<class U> R operator()(U & u, A1 a1) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1);
     }
 
 #endif
 
     R operator()(T & t, A1 a1) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf1) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf1) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf1) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf1) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -199,7 +199,7 @@
 
 // cmf1
 
-template<class R, class T, class A1 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf1)
+template<class R, class T, class A1 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf1)
 {
 public:
 
@@ -209,40 +209,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1) const)
     F f_;
 
     template<class U, class B1> R call(U & u, T const *, B1 & b1) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1);
     }
 
     template<class U, class B1> R call(U & u, void const *, B1 & b1) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf1)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf1)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1);
     }
 
     R operator()(T const & t, A1 a1) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf1) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf1) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf1) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf1) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -250,7 +250,7 @@
 
 // mf2
 
-template<class R, class T, class A1, class A2 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf2)
+template<class R, class T, class A1, class A2 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf2)
 {
 public:
 
@@ -258,55 +258,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2))
     F f_;
 
     template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
     }
 
     template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf2)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf2)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf2) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf2) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf2) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf2) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -314,7 +314,7 @@
 
 // cmf2
 
-template<class R, class T, class A1, class A2 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf2)
+template<class R, class T, class A1, class A2 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf2)
 {
 public:
 
@@ -322,40 +322,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2) const)
     F f_;
 
     template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
     }
 
     template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf2)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf2)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2);
     }
 
     R operator()(T const & t, A1 a1, A2 a2) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf2) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf2) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf2) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf2) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -363,7 +363,7 @@
 
 // mf3
 
-template<class R, class T, class A1, class A2, class A3 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf3)
+template<class R, class T, class A1, class A2, class A3 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf3)
 {
 public:
 
@@ -371,55 +371,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3))
     F f_;
 
     template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
     }
 
     template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf3)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf3)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2, A3 a3) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2, A3 a3) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf3) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf3) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf3) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf3) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -427,7 +427,7 @@
 
 // cmf3
 
-template<class R, class T, class A1, class A2, class A3 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf3)
+template<class R, class T, class A1, class A2, class A3 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf3)
 {
 public:
 
@@ -435,40 +435,40 @@
 
 private:
 
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3) const)
     F f_;
 
     template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
     }
 
     template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
     }
 
 public:
 
-    explicit BOOST_MEM_FN_NAME(cmf3)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf3)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3);
     }
 
     R operator()(T const & t, A1 a1, A2 a2, A3 a3) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf3) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf3) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf3) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf3) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -476,7 +476,7 @@
 
 // mf4
 
-template<class R, class T, class A1, class A2, class A3, class A4 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf4)
+template<class R, class T, class A1, class A2, class A3, class A4 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf4)
 {
 public:
 
@@ -484,55 +484,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4))
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
     }
 
     template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf4)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf4)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf4) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf4) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf4) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf4) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -540,7 +540,7 @@
 
 // cmf4
 
-template<class R, class T, class A1, class A2, class A3, class A4 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf4)
+template<class R, class T, class A1, class A2, class A3, class A4 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf4)
 {
 public:
 
@@ -548,40 +548,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const)
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
     }
 
     template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf4)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf4)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4);
     }
 
     R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf4) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf4) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf4) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf4) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -589,7 +589,7 @@
 
 // mf5
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf5)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf5)
 {
 public:
 
@@ -597,55 +597,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5))
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf5)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf5)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf5) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf5) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf5) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf5) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -653,7 +653,7 @@
 
 // cmf5
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf5)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf5)
 {
 public:
 
@@ -661,40 +661,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const)
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf5)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf5)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5);
     }
 
     R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf5) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf5) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf5) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf5) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -702,7 +702,7 @@
 
 // mf6
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf6)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf6)
 {
 public:
 
@@ -710,55 +710,55 @@
 
 private:
 
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6))
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
     }
 
 public:
 
-    explicit BOOST_MEM_FN_NAME(mf6)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf6)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf6) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf6) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf6) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf6) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -766,7 +766,7 @@
 
 // cmf6
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf6)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf6)
 {
 public:
 
@@ -774,40 +774,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const)
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf6)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf6)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6);
     }
 
     R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf6) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf6) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf6) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf6) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -815,7 +815,7 @@
 
 // mf7
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf7)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf7)
 {
 public:
 
@@ -823,55 +823,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7))
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf7)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf7)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf7) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf7) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf7) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf7) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -879,7 +879,7 @@
 
 // cmf7
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf7)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf7)
 {
 public:
 
@@ -887,40 +887,40 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const)
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf7)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf7)(F f): f_(f) {}
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7);
     }
 
     R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf7) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf7) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf7) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf7) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -928,7 +928,7 @@
 
 // mf8
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf8)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(mf8)
 {
 public:
 
@@ -936,55 +936,55 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8))
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8))
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(mf8)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(mf8)(F f): f_(f) {}
 
     R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
     template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
-#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#ifdef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
 #endif
 
     R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(mf8) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(mf8) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(mf8) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(mf8) const & rhs) const
     {
         return f_ != rhs.f_;
     }
@@ -992,7 +992,7 @@
 
 // cmf8
 
-template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf8)
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 NDNBOOST_MEM_FN_CLASS_F> class NDNBOOST_MEM_FN_NAME(cmf8)
 {
 public:
 
@@ -1000,48 +1000,48 @@
 
 private:
     
-    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const)
+    NDNBOOST_MEM_FN_TYPEDEF(R (NDNBOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const)
     F f_;
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
     {
-        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+        NDNBOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
     }
 
     template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
     {
-        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+        NDNBOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
     }
 
 public:
     
-    explicit BOOST_MEM_FN_NAME(cmf8)(F f): f_(f) {}
+    explicit NDNBOOST_MEM_FN_NAME(cmf8)(F f): f_(f) {}
 
     R operator()(T const * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
-        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
     template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
         U const * p = 0;
-        BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
     R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
     {
-        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+        NDNBOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
     }
 
-    bool operator==(BOOST_MEM_FN_NAME(cmf8) const & rhs) const
+    bool operator==(NDNBOOST_MEM_FN_NAME(cmf8) const & rhs) const
     {
         return f_ == rhs.f_;
     }
 
-    bool operator!=(BOOST_MEM_FN_NAME(cmf8) const & rhs) const
+    bool operator!=(NDNBOOST_MEM_FN_NAME(cmf8) const & rhs) const
     {
         return f_ != rhs.f_;
     }
 };
 
-#undef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
+#undef NDNBOOST_MEM_FN_ENABLE_CONST_OVERLOADS
