diff --git a/ndnboost/move/algorithm.hpp b/ndnboost/move/algorithm.hpp
new file mode 100644
index 0000000..0feaef3
--- /dev/null
+++ b/ndnboost/move/algorithm.hpp
@@ -0,0 +1,275 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_ALGORITHM_HPP
+#define BOOST_MOVE_ALGORITHM_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+
+#include <ndnboost/move/utility.hpp>
+#include <ndnboost/move/iterator.hpp>
+#include <ndnboost/move/algorithm.hpp>
+#include <ndnboost/detail/no_exceptions_support.hpp>
+
+#include <algorithm> //copy, copy_backward
+#include <memory>    //uninitialized_copy
+
+namespace ndnboost {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                               move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
+
+   //! <b>Effects</b>: Moves elements in the range [first,last) into the range [result,result + (last -
+   //!   first)) starting from first and proceeding to last. For each non-negative integer n < (last-first),
+   //!   performs *(result + n) = ::ndnboost::move (*(first + n)).
+   //!
+   //! <b>Effects</b>: result + (last - first).
+   //!
+   //! <b>Requires</b>: result shall not be in the range [first,last).
+   //!
+   //! <b>Complexity</b>: Exactly last - first move assignments.
+   template <typename I, // I models InputIterator
+            typename O> // O models OutputIterator
+   O move(I f, I l, O result)
+   {
+      while (f != l) {
+         *result = ::ndnboost::move(*f);
+         ++f; ++result;
+      }
+      return result;
+   }
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                               move_backward
+   //
+   //////////////////////////////////////////////////////////////////////////////
+
+   //! <b>Effects</b>: Moves elements in the range [first,last) into the range
+   //!   [result - (last-first),result) starting from last - 1 and proceeding to
+   //!   first. For each positive integer n <= (last - first),
+   //!   performs *(result - n) = ::ndnboost::move(*(last - n)).
+   //!
+   //! <b>Requires</b>: result shall not be in the range [first,last).
+   //!
+   //! <b>Returns</b>: result - (last - first).
+   //!
+   //! <b>Complexity</b>: Exactly last - first assignments.
+   template <typename I, // I models BidirectionalIterator
+   typename O> // O models BidirectionalIterator
+   O move_backward(I f, I l, O result)
+   {
+      while (f != l) {
+         --l; --result;
+         *result = ::ndnboost::move(*l);
+      }
+      return result;
+   }
+
+#else
+
+   using ::std::move_backward;
+
+#endif   //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                               uninitialized_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! <b>Effects</b>:
+//!   \code
+//!   for (; first != last; ++result, ++first)
+//!      new (static_cast<void*>(&*result))
+//!         typename iterator_traits<ForwardIterator>::value_type(ndnboost::move(*first));
+//!   \endcode
+//!
+//! <b>Returns</b>: result
+template
+   <typename I, // I models InputIterator
+    typename F> // F models ForwardIterator
+F uninitialized_move(I f, I l, F r
+   /// @cond
+//   ,typename ::ndnboost::move_detail::enable_if<has_move_emulation_enabled<typename std::iterator_traits<I>::value_type> >::type* = 0
+   /// @endcond
+   )
+{
+   typedef typename std::iterator_traits<I>::value_type input_value_type;
+
+   F back = r;
+   BOOST_TRY{
+      while (f != l) {
+         void * const addr = static_cast<void*>(::ndnboost::move_detail::addressof(*r));
+         ::new(addr) input_value_type(::ndnboost::move(*f));
+         ++f; ++r;
+      }
+   }
+   BOOST_CATCH(...){
+	   for (; back != r; ++back){
+         back->~input_value_type();
+      }
+	   BOOST_RETHROW;
+   }
+   BOOST_CATCH_END
+   return r;
+}
+
+/// @cond
+/*
+template
+   <typename I,   // I models InputIterator
+    typename F>   // F models ForwardIterator
+F uninitialized_move(I f, I l, F r,
+   typename ::ndnboost::move_detail::disable_if<has_move_emulation_enabled<typename std::iterator_traits<I>::value_type> >::type* = 0)
+{
+   return std::uninitialized_copy(f, l, r);
+}
+*/
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                            uninitialized_copy_or_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+namespace move_detail {
+
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+inline F uninitialized_move_move_iterator(I f, I l, F r
+//                             ,typename ::ndnboost::move_detail::enable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0
+)
+{
+   return ::ndnboost::uninitialized_move(f, l, r);
+}
+/*
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+F uninitialized_move_move_iterator(I f, I l, F r,
+                                   typename ::ndnboost::move_detail::disable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0)
+{
+   return std::uninitialized_copy(f.base(), l.base(), r);
+}
+*/
+}  //namespace move_detail {
+
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+inline F uninitialized_copy_or_move(I f, I l, F r,
+                             typename ::ndnboost::move_detail::enable_if< move_detail::is_move_iterator<I> >::type* = 0)
+{
+   return ::ndnboost::move_detail::uninitialized_move_move_iterator(f, l, r);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                            copy_or_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+namespace move_detail {
+
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+inline F move_move_iterator(I f, I l, F r
+//                             ,typename ::ndnboost::move_detail::enable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0
+)
+{
+   return ::ndnboost::move(f, l, r);
+}
+/*
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+F move_move_iterator(I f, I l, F r,
+                                   typename ::ndnboost::move_detail::disable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0)
+{
+   return std::copy(f.base(), l.base(), r);
+}
+*/
+
+}  //namespace move_detail {
+
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+inline F copy_or_move(I f, I l, F r,
+                             typename ::ndnboost::move_detail::enable_if< move_detail::is_move_iterator<I> >::type* = 0)
+{
+   return ::ndnboost::move_detail::move_move_iterator(f, l, r);
+}
+
+/// @endcond
+
+//! <b>Effects</b>:
+//!   \code
+//!   for (; first != last; ++result, ++first)
+//!      new (static_cast<void*>(&*result))
+//!         typename iterator_traits<ForwardIterator>::value_type(*first);
+//!   \endcode
+//!
+//! <b>Returns</b>: result
+//!
+//! <b>Note</b>: This function is provided because
+//!   <i>std::uninitialized_copy</i> from some STL implementations
+//!    is not compatible with <i>move_iterator</i>
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+inline F uninitialized_copy_or_move(I f, I l, F r
+   /// @cond
+   ,typename ::ndnboost::move_detail::disable_if< move_detail::is_move_iterator<I> >::type* = 0
+   /// @endcond
+   )
+{
+   return std::uninitialized_copy(f, l, r);
+}
+
+//! <b>Effects</b>:
+//!   \code
+//!   for (; first != last; ++result, ++first)
+//!      *result = *first;
+//!   \endcode
+//!
+//! <b>Returns</b>: result
+//!
+//! <b>Note</b>: This function is provided because
+//!   <i>std::uninitialized_copy</i> from some STL implementations
+//!    is not compatible with <i>move_iterator</i>
+template
+<typename I,   // I models InputIterator
+typename F>   // F models ForwardIterator
+inline F copy_or_move(I f, I l, F r
+   /// @cond
+   ,typename ::ndnboost::move_detail::disable_if< move_detail::is_move_iterator<I> >::type* = 0
+   /// @endcond
+   )
+{
+   return std::copy(f, l, r);
+}
+
+}  //namespace ndnboost {
+
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_MOVE_HPP
diff --git a/ndnboost/move/core.hpp b/ndnboost/move/core.hpp
new file mode 100644
index 0000000..92e47ec
--- /dev/null
+++ b/ndnboost/move/core.hpp
@@ -0,0 +1,332 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file core.hpp
+//! This header implements macros to define movable classes and
+//! move-aware functions
+
+#ifndef BOOST_MOVE_CORE_HPP
+#define BOOST_MOVE_CORE_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
+   #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
+      private:\
+      TYPE(TYPE &);\
+      TYPE& operator=(TYPE &);\
+   //
+#else
+   #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
+      public:\
+      TYPE(TYPE const &) = delete;\
+      TYPE& operator=(TYPE const &) = delete;\
+      private:\
+   //
+#endif   //BOOST_NO_CXX11_DELETED_FUNCTIONS
+
+#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+   #include <ndnboost/move/detail/meta_utils.hpp>
+
+   //Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
+   #if defined(__GNUC__) && (__GNUC__ >= 4)
+      #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
+   #else
+      #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
+   #endif
+
+   namespace ndnboost {
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                            struct rv
+   //
+   //////////////////////////////////////////////////////////////////////////////
+   template <class T>
+   class rv
+      : public ::ndnboost::move_detail::if_c
+         < ::ndnboost::move_detail::is_class_or_union<T>::value
+         , T
+         , ::ndnboost::move_detail::empty
+         >::type
+   {
+      rv();
+      ~rv();
+      rv(rv const&);
+      void operator=(rv const&);
+   } BOOST_MOVE_ATTRIBUTE_MAY_ALIAS;
+
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                            move_detail::is_rv
+   //
+   //////////////////////////////////////////////////////////////////////////////
+
+   namespace move_detail {
+
+   template <class T>
+   struct is_rv
+      : ::ndnboost::move_detail::integral_constant<bool, false>
+   {};
+
+   template <class T>
+   struct is_rv< rv<T> >
+      : ::ndnboost::move_detail::integral_constant<bool, true>
+   {};
+
+   template <class T>
+   struct is_rv< const rv<T> >
+      : ::ndnboost::move_detail::integral_constant<bool, true>
+   {};
+
+   }  //namespace move_detail {
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                               has_move_emulation_enabled
+   //
+   //////////////////////////////////////////////////////////////////////////////
+   template<class T>
+   struct has_move_emulation_enabled
+      : ::ndnboost::move_detail::is_convertible< T, ::ndnboost::rv<T>& >
+   {};
+
+   template<class T>
+   struct has_move_emulation_enabled<T&>
+      : ::ndnboost::move_detail::integral_constant<bool, false>
+   {};
+
+   template<class T>
+   struct has_move_emulation_enabled< ::ndnboost::rv<T> >
+      : ::ndnboost::move_detail::integral_constant<bool, false>
+   {};
+
+   }  //namespace ndnboost {
+
+   #define BOOST_RV_REF(TYPE)\
+      ::ndnboost::rv< TYPE >& \
+   //
+
+   #define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+      ::ndnboost::rv< TYPE<ARG1, ARG2> >& \
+   //
+
+   #define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+      ::ndnboost::rv< TYPE<ARG1, ARG2, ARG3> >& \
+   //
+
+   #define BOOST_RV_REF_BEG\
+      ::ndnboost::rv<   \
+   //
+
+   #define BOOST_RV_REF_END\
+      >& \
+   //
+
+   #define BOOST_FWD_REF(TYPE)\
+      const TYPE & \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF(TYPE)\
+      const ::ndnboost::rv< TYPE >& \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_BEG \
+      const ::ndnboost::rv<  \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_END \
+      >& \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+      const ::ndnboost::rv< TYPE<ARG1, ARG2> >& \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+      const ::ndnboost::rv< TYPE<ARG1, ARG2, ARG3> >& \
+   //
+
+   #define BOOST_CATCH_CONST_RLVALUE(TYPE)\
+      const ::ndnboost::rv< TYPE >& \
+   //
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                         BOOST_MOVABLE_BUT_NOT_COPYABLE
+   //
+   //////////////////////////////////////////////////////////////////////////////
+   #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
+      BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\
+      public:\
+      operator ::ndnboost::rv<TYPE>&() \
+      {  return *static_cast< ::ndnboost::rv<TYPE>* >(this);  }\
+      operator const ::ndnboost::rv<TYPE>&() const \
+      {  return *static_cast<const ::ndnboost::rv<TYPE>* >(this);  }\
+      private:\
+   //
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                         BOOST_COPYABLE_AND_MOVABLE
+   //
+   //////////////////////////////////////////////////////////////////////////////
+
+   #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
+      public:\
+      TYPE& operator=(TYPE &t)\
+      {  this->operator=(static_cast<const ::ndnboost::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\
+      public:\
+      operator ::ndnboost::rv<TYPE>&() \
+      {  return *static_cast< ::ndnboost::rv<TYPE>* >(this);  }\
+      operator const ::ndnboost::rv<TYPE>&() const \
+      {  return *static_cast<const ::ndnboost::rv<TYPE>* >(this);  }\
+      private:\
+   //
+
+   #define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\
+      public:\
+      operator ::ndnboost::rv<TYPE>&() \
+      {  return *static_cast< ::ndnboost::rv<TYPE>* >(this);  }\
+      operator const ::ndnboost::rv<TYPE>&() const \
+      {  return *static_cast<const ::ndnboost::rv<TYPE>* >(this);  }\
+      private:\
+   //
+
+#else    //BOOST_NO_CXX11_RVALUE_REFERENCES
+
+   //Compiler workaround detection
+   #if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+      #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__)
+         //Pre-standard rvalue binding rules
+         #define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+      #elif defined(_MSC_VER) && (_MSC_VER == 1600)
+         //Standard rvalue binding rules but with some bugs
+         #define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
+         //Use standard library for MSVC to avoid namespace issues as
+         //some move calls in the STL are not fully qualified.
+         //#define BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
+      #endif
+   #endif
+
+   //! This macro marks a type as movable but not copyable, disabling copy construction
+   //! and assignment. The user will need to write a move constructor/assignment as explained
+   //! in the documentation to fully write a movable but not copyable class.
+   #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
+      BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\
+      public:\
+      typedef int boost_move_emulation_t;\
+   //
+
+   //! This macro marks a type as copyable and movable.
+   //! The user will need to write a move constructor/assignment and a copy assignment
+   //! as explained in the documentation to fully write a copyable and movable class.
+   #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
+   //
+
+   #if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+   #define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\
+   //
+   #endif   //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+   namespace ndnboost {
+
+   //!This trait yields to a compile-time true boolean if T was marked as
+   //!BOOST_MOVABLE_BUT_NOT_COPYABLE or BOOST_COPYABLE_AND_MOVABLE and
+   //!rvalue references are not available on the platform. False otherwise.
+   template<class T>
+   struct has_move_emulation_enabled
+   {
+      static const bool value = false;
+   };
+
+   }  //namespace ndnboost{
+
+   //!This macro is used to achieve portable syntax in move
+   //!constructors and assignments for classes marked as
+   //!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE
+   #define BOOST_RV_REF(TYPE)\
+      TYPE && \
+   //
+
+   //!This macro is used to achieve portable syntax in move
+   //!constructors and assignments for template classes marked as
+   //!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
+   //!As macros have problems with comma-separatd template arguments,
+   //!the template argument must be preceded with BOOST_RV_REF_START
+   //!and ended with BOOST_RV_REF_END
+   #define BOOST_RV_REF_BEG\
+         \
+   //
+
+   //!This macro is used to achieve portable syntax in move
+   //!constructors and assignments for template classes marked as
+   //!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
+   //!As macros have problems with comma-separatd template arguments,
+   //!the template argument must be preceded with BOOST_RV_REF_START
+   //!and ended with BOOST_RV_REF_END
+   #define BOOST_RV_REF_END\
+      && \
+
+   //!This macro is used to achieve portable syntax in copy
+   //!assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.
+   #define BOOST_COPY_ASSIGN_REF(TYPE)\
+      const TYPE & \
+   //
+
+   //! This macro is used to implement portable perfect forwarding
+   //! as explained in the documentation.
+   #define BOOST_FWD_REF(TYPE)\
+      TYPE && \
+   //
+
+   #if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+   /// @cond
+
+   #define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+      TYPE<ARG1, ARG2> && \
+   //
+
+   #define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+      TYPE<ARG1, ARG2, ARG3> && \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_BEG \
+      const \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_END \
+      & \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+      const TYPE<ARG1, ARG2> & \
+   //
+
+   #define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+      const TYPE<ARG1, ARG2, ARG3>& \
+   //
+
+   #define BOOST_CATCH_CONST_RLVALUE(TYPE)\
+      const TYPE & \
+   //
+
+   /// @endcond
+
+   #endif   //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+#endif   //BOOST_NO_CXX11_RVALUE_REFERENCES
+
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_CORE_HPP
diff --git a/ndnboost/move/detail/config_begin.hpp b/ndnboost/move/detail/config_begin.hpp
new file mode 100644
index 0000000..4368aeb
--- /dev/null
+++ b/ndnboost/move/detail/config_begin.hpp
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <ndnboost/config.hpp>
+
+#ifdef BOOST_MSVC
+   #ifndef _CRT_SECURE_NO_DEPRECATE
+      #define  BOOST_MOVE_CRT_SECURE_NO_DEPRECATE
+      #define _CRT_SECURE_NO_DEPRECATE
+   #endif
+   #ifndef _SCL_SECURE_NO_WARNINGS
+      #define  BOOST_MOVE_SCL_SECURE_NO_WARNINGS
+      #define _SCL_SECURE_NO_WARNINGS
+   #endif
+   #pragma warning (push)
+   #pragma warning (disable : 4996) // "function": was declared deprecated
+#endif
diff --git a/ndnboost/move/detail/config_end.hpp b/ndnboost/move/detail/config_end.hpp
new file mode 100644
index 0000000..c43bce0
--- /dev/null
+++ b/ndnboost/move/detail/config_end.hpp
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#if defined BOOST_MSVC
+   #pragma warning (pop)
+   #ifdef BOOST_MOVE_DETAIL_CRT_SECURE_NO_DEPRECATE
+      #undef BOOST_MOVE_DETAIL_CRT_SECURE_NO_DEPRECATE
+      #undef _CRT_SECURE_NO_DEPRECATE
+   #endif
+   #ifndef BOOST_MOVE_SCL_SECURE_NO_WARNINGS
+      #undef  BOOST_MOVE_SCL_SECURE_NO_WARNINGS
+      #undef _SCL_SECURE_NO_WARNINGS
+   #endif
+#endif
diff --git a/ndnboost/move/detail/meta_utils.hpp b/ndnboost/move/detail/meta_utils.hpp
new file mode 100644
index 0000000..1f68fb2
--- /dev/null
+++ b/ndnboost/move/detail/meta_utils.hpp
@@ -0,0 +1,158 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP
+#define BOOST_MOVE_DETAIL_META_UTILS_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+
+//Small meta-typetraits to support move
+
+namespace ndnboost {
+namespace move_detail {
+
+//if_
+template<bool C, typename T1, typename T2>
+struct if_c
+{
+   typedef T1 type;
+};
+
+template<typename T1, typename T2>
+struct if_c<false,T1,T2>
+{
+   typedef T2 type;
+};
+
+template<typename T1, typename T2, typename T3>
+struct if_
+{
+   typedef typename if_c<0 != T1::value, T2, T3>::type type;
+};
+
+//enable_if_
+template <bool B, class T = void>
+struct enable_if_c
+{
+   typedef T type;
+};
+
+template <class T>
+struct enable_if_c<false, T> {};
+
+template <class Cond, class T = void>
+struct enable_if : public enable_if_c<Cond::value, T> {};
+
+template <class Cond, class T = void>
+struct disable_if : public enable_if_c<!Cond::value, T> {};
+
+//integral_constant
+template<class T, T v>
+struct integral_constant
+{
+   static const T value = v;
+   typedef T value_type;
+   typedef integral_constant<T, v> type;
+};
+
+//identity
+template <class T>
+struct identity
+{
+   typedef T type;
+};
+
+//is_convertible
+template <class T, class U>
+class is_convertible
+{
+   typedef char true_t;
+   class false_t { char dummy[2]; };
+   static true_t dispatch(U);
+   static false_t dispatch(...);
+   static T &trigger();
+   public:
+   enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
+};
+
+//and_ not_
+template <typename Condition1, typename Condition2, typename Condition3 = integral_constant<bool, true> >
+struct and_
+   : public integral_constant<bool, Condition1::value && Condition2::value && Condition3::value>
+{};
+
+template <typename Boolean>
+struct not_
+   : public integral_constant<bool, !Boolean::value>
+{};
+
+//is_lvalue_reference
+template<class T>
+struct is_lvalue_reference
+   : public integral_constant<bool, false>
+{};
+
+template<class T>
+struct is_lvalue_reference<T&>
+   : public integral_constant<bool, true>
+{};
+
+template<class T>
+struct is_class_or_union
+{
+   struct twochar { char _[2]; };
+   template <class U>
+   static char is_class_or_union_tester(void(U::*)(void));
+   template <class U>
+   static twochar is_class_or_union_tester(...);
+   static const bool value = sizeof(is_class_or_union_tester<T>(0)) == sizeof(char);
+};
+
+struct empty{};
+
+//addressof
+template<class T> struct addr_impl_ref
+{
+   T & v_;
+   inline addr_impl_ref( T & v ): v_( v ) {}
+   inline operator T& () const { return v_; }
+
+   private:
+   addr_impl_ref & operator=(const addr_impl_ref &);
+};
+
+template<class T> struct addressof_impl
+{
+   static inline T * f( T & v, long )
+   {
+      return reinterpret_cast<T*>(
+         &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
+   }
+
+   static inline T * f( T * v, int )
+   {  return v;  }
+};
+
+template<class T>
+inline T * addressof( T & v )
+{
+   return ::ndnboost::move_detail::addressof_impl<T>::f
+      ( ::ndnboost::move_detail::addr_impl_ref<T>( v ), 0 );
+}
+
+}  //namespace move_detail {
+}  //namespace ndnboost {
+
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP
diff --git a/ndnboost/move/iterator.hpp b/ndnboost/move/iterator.hpp
new file mode 100644
index 0000000..12339b0
--- /dev/null
+++ b/ndnboost/move/iterator.hpp
@@ -0,0 +1,298 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_ITERATOR_HPP
+#define BOOST_MOVE_ITERATOR_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+#include <ndnboost/move/utility.hpp>
+#include <iterator>  //std::iterator
+
+namespace ndnboost {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                            move_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! Class template move_iterator is an iterator adaptor with the same behavior
+//! as the underlying iterator except that its dereference operator implicitly
+//! converts the value returned by the underlying iterator's dereference operator
+//! to an rvalue reference. Some generic algorithms can be called with move
+//! iterators to replace copying with moving.
+template <class It>
+class move_iterator
+{
+   public:
+   typedef It                                                              iterator_type;
+   typedef typename std::iterator_traits<iterator_type>::value_type        value_type;
+   #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
+   typedef value_type &&                                                   reference;
+   #else
+   typedef typename ::ndnboost::move_detail::if_
+      < ::ndnboost::has_move_emulation_enabled<value_type>
+      , ::ndnboost::rv<value_type>&
+      , value_type & >::type                                               reference;
+   #endif
+   typedef It                                                              pointer;
+   typedef typename std::iterator_traits<iterator_type>::difference_type   difference_type;
+   typedef typename std::iterator_traits<iterator_type>::iterator_category iterator_category;
+
+   move_iterator()
+   {}
+
+   explicit move_iterator(It i)
+      :  m_it(i)
+   {}
+
+   template <class U>
+   move_iterator(const move_iterator<U>& u)
+      :  m_it(u.base())
+   {}
+
+   iterator_type base() const
+   {  return m_it;   }
+
+   reference operator*() const
+   {
+      #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+      return *m_it;
+      #else
+      return ::ndnboost::move(*m_it);
+      #endif
+   }
+
+   pointer   operator->() const
+   {  return m_it;   }
+
+   move_iterator& operator++()
+   {  ++m_it; return *this;   }
+
+   move_iterator<iterator_type>  operator++(int)
+   {  move_iterator<iterator_type> tmp(*this); ++(*this); return tmp;   }
+
+   move_iterator& operator--()
+   {  --m_it; return *this;   }
+
+   move_iterator<iterator_type>  operator--(int)
+   {  move_iterator<iterator_type> tmp(*this); --(*this); return tmp;   }
+
+   move_iterator<iterator_type>  operator+ (difference_type n) const
+   {  return move_iterator<iterator_type>(m_it + n);  }
+
+   move_iterator& operator+=(difference_type n)
+   {  m_it += n; return *this;   }
+
+   move_iterator<iterator_type>  operator- (difference_type n) const
+   {  return move_iterator<iterator_type>(m_it - n);  }
+
+   move_iterator& operator-=(difference_type n)
+   {  m_it -= n; return *this;   }
+
+   reference operator[](difference_type n) const
+   {
+      #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+      return m_it[n];
+      #else
+      return ::ndnboost::move(m_it[n]);
+      #endif
+   }
+
+   friend bool operator==(const move_iterator& x, const move_iterator& y)
+   {  return x.base() == y.base();  }
+
+   friend bool operator!=(const move_iterator& x, const move_iterator& y)
+   {  return x.base() != y.base();  }
+
+   friend bool operator< (const move_iterator& x, const move_iterator& y)
+   {  return x.base() < y.base();   }
+
+   friend bool operator<=(const move_iterator& x, const move_iterator& y)
+   {  return x.base() <= y.base();  }
+
+   friend bool operator> (const move_iterator& x, const move_iterator& y)
+   {  return x.base() > y.base();  }
+
+   friend bool operator>=(const move_iterator& x, const move_iterator& y)
+   {  return x.base() >= y.base();  }
+
+   friend difference_type operator-(const move_iterator& x, const move_iterator& y)
+   {  return x.base() - y.base();   }
+
+   friend move_iterator operator+(difference_type n, const move_iterator& x)
+   {  return move_iterator(x.base() + n);   }
+
+   private:
+   It m_it;
+};
+
+//is_move_iterator
+namespace move_detail {
+
+template <class I>
+struct is_move_iterator
+   : public ::ndnboost::move_detail::integral_constant<bool, false>
+{
+};
+
+template <class I>
+struct is_move_iterator< ::ndnboost::move_iterator<I> >
+   : public ::ndnboost::move_detail::integral_constant<bool, true>
+{
+};
+
+}  //namespace move_detail {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                            move_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//!
+//! <b>Returns</b>: move_iterator<It>(i).
+template<class It>
+inline move_iterator<It> make_move_iterator(const It &it)
+{  return move_iterator<It>(it); }
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                         back_move_insert_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+//! A move insert iterator that move constructs elements at the
+//! back of a container
+template <typename C> // C models Container
+class back_move_insert_iterator
+   : public std::iterator<std::output_iterator_tag, void, void, void, void>
+{
+   C* container_m;
+
+   public:
+   typedef C                        container_type;
+   typedef typename C::value_type   value_type;
+   typedef typename C::reference    reference;
+
+   explicit back_move_insert_iterator(C& x) : container_m(&x) { }
+
+   back_move_insert_iterator& operator=(reference x)
+   { container_m->push_back(ndnboost::move(x)); return *this; }
+
+   back_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+   {  reference rx = x; return this->operator=(rx);  }
+
+   back_move_insert_iterator& operator*()     { return *this; }
+   back_move_insert_iterator& operator++()    { return *this; }
+   back_move_insert_iterator& operator++(int) { return *this; }
+};
+
+//!
+//! <b>Returns</b>: back_move_insert_iterator<C>(x).
+template <typename C> // C models Container
+inline back_move_insert_iterator<C> back_move_inserter(C& x)
+{
+   return back_move_insert_iterator<C>(x);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                         front_move_insert_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! A move insert iterator that move constructs elements int the
+//! front of a container
+template <typename C> // C models Container
+class front_move_insert_iterator
+   : public std::iterator<std::output_iterator_tag, void, void, void, void>
+{
+   C* container_m;
+
+public:
+   typedef C                        container_type;
+   typedef typename C::value_type   value_type;
+   typedef typename C::reference    reference;
+
+   explicit front_move_insert_iterator(C& x) : container_m(&x) { }
+
+   front_move_insert_iterator& operator=(reference x)
+   { container_m->push_front(ndnboost::move(x)); return *this; }
+
+   front_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+   {  reference rx = x; return this->operator=(rx);  }
+
+   front_move_insert_iterator& operator*()     { return *this; }
+   front_move_insert_iterator& operator++()    { return *this; }
+   front_move_insert_iterator& operator++(int) { return *this; }
+};
+
+//!
+//! <b>Returns</b>: front_move_insert_iterator<C>(x).
+template <typename C> // C models Container
+inline front_move_insert_iterator<C> front_move_inserter(C& x)
+{
+   return front_move_insert_iterator<C>(x);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//                         insert_move_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+template <typename C> // C models Container
+class move_insert_iterator
+   : public std::iterator<std::output_iterator_tag, void, void, void, void>
+{
+   C* container_m;
+   typename C::iterator pos_;
+
+   public:
+   typedef C                        container_type;
+   typedef typename C::value_type   value_type;
+   typedef typename C::reference    reference;
+
+   explicit move_insert_iterator(C& x, typename C::iterator pos)
+      : container_m(&x), pos_(pos)
+   {}
+
+   move_insert_iterator& operator=(reference x)
+   {
+      pos_ = container_m->insert(pos_, ::ndnboost::move(x));
+      ++pos_;
+      return *this;
+   }
+
+   move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+   {  reference rx = x; return this->operator=(rx);  }
+
+   move_insert_iterator& operator*()     { return *this; }
+   move_insert_iterator& operator++()    { return *this; }
+   move_insert_iterator& operator++(int) { return *this; }
+};
+
+//!
+//! <b>Returns</b>: move_insert_iterator<C>(x, it).
+template <typename C> // C models Container
+inline move_insert_iterator<C> move_inserter(C& x, typename C::iterator it)
+{
+   return move_insert_iterator<C>(x, it);
+}
+
+}  //namespace ndnboost {
+
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_ITERATOR_HPP
diff --git a/ndnboost/move/move.hpp b/ndnboost/move/move.hpp
new file mode 100644
index 0000000..822ffb5
--- /dev/null
+++ b/ndnboost/move/move.hpp
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright David Abrahams, Vicente Botet 2009.
+// (C) Copyright Ion Gaztanaga 2009-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file move.hpp
+//! A general library header that includes
+//! the rest of top-level headers.
+
+#ifndef BOOST_MOVE_MOVE_HPP
+#define BOOST_MOVE_MOVE_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+#include <ndnboost/move/utility.hpp>
+#include <ndnboost/move/iterator.hpp>
+#include <ndnboost/move/traits.hpp>
+#include <ndnboost/move/algorithm.hpp>
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_MOVE_HPP
diff --git a/ndnboost/move/traits.hpp b/ndnboost/move/traits.hpp
new file mode 100644
index 0000000..47d585d
--- /dev/null
+++ b/ndnboost/move/traits.hpp
@@ -0,0 +1,142 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_MOVE_TRAITS_HPP
+#define BOOST_MOVE_MOVE_TRAITS_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+#include <ndnboost/type_traits/has_trivial_destructor.hpp>
+#include <ndnboost/move/detail/meta_utils.hpp>
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+#include <ndnboost/move/core.hpp>
+#endif
+
+namespace ndnboost {
+
+//! If this trait yields to true
+//! (<i>has_trivial_destructor_after_move &lt;T&gt;::value == true</i>)
+//! means that if T is used as argument of a move construction/assignment,
+//! there is no need to call T's destructor.
+//! This optimization tipically is used to improve containers' performance.
+//!
+//! By default this trait is true if the type has trivial destructor,
+//! every class should specialize this trait if it wants to improve performance
+//! when inserted in containers.
+template <class T>
+struct has_trivial_destructor_after_move
+   : ::ndnboost::has_trivial_destructor<T>
+{};
+
+//! By default this traits returns false. Classes with non-throwing move constructor
+//! and assignment can specialize this trait to obtain some performance improvements.
+template <class T>
+struct has_nothrow_move
+   : public ::ndnboost::move_detail::integral_constant<bool, false>
+{};
+
+namespace move_detail {
+
+// Code from Jeffrey Lee Hellrung, many thanks
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T> struct forward_type { typedef T type; };
+#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T>
+   struct forward_type
+   { typedef const T &type; };
+
+   template< class T>
+   struct forward_type< ndnboost::rv<T> >
+   { typedef T type; };
+#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+template< class T > struct is_rvalue_reference : ::ndnboost::move_detail::integral_constant<bool, false> { };
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T > struct is_rvalue_reference< T&& > : ::ndnboost::move_detail::integral_constant<bool, true> { };
+#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T > struct is_rvalue_reference< ndnboost::rv<T>& >
+      :  ::ndnboost::move_detail::integral_constant<bool, true>
+   {};
+
+   template< class T > struct is_rvalue_reference< const ndnboost::rv<T>& >
+      : ::ndnboost::move_detail::integral_constant<bool, true>
+   {};
+#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T > struct add_rvalue_reference { typedef T&& type; };
+#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   namespace detail_add_rvalue_reference
+   {
+      template< class T
+              , bool emulation = ::ndnboost::has_move_emulation_enabled<T>::value
+              , bool rv        = ::ndnboost::move_detail::is_rv<T>::value  >
+      struct add_rvalue_reference_impl { typedef T type; };
+
+      template< class T, bool emulation>
+      struct add_rvalue_reference_impl< T, emulation, true > { typedef T & type; };
+
+      template< class T, bool rv >
+      struct add_rvalue_reference_impl< T, true, rv > { typedef ::ndnboost::rv<T>& type; };
+   } // namespace detail_add_rvalue_reference
+
+   template< class T >
+   struct add_rvalue_reference
+      : detail_add_rvalue_reference::add_rvalue_reference_impl<T>
+   { };
+
+   template< class T >
+   struct add_rvalue_reference<T &>
+   {  typedef T & type; };
+
+#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+template< class T > struct remove_rvalue_reference { typedef T type; };
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T > struct remove_rvalue_reference< T&& >                  { typedef T type; };
+#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+   template< class T > struct remove_rvalue_reference< rv<T> >                { typedef T type; };
+   template< class T > struct remove_rvalue_reference< const rv<T> >          { typedef T type; };
+   template< class T > struct remove_rvalue_reference< volatile rv<T> >       { typedef T type; };
+   template< class T > struct remove_rvalue_reference< const volatile rv<T> > { typedef T type; };
+   template< class T > struct remove_rvalue_reference< rv<T>& >               { typedef T type; };
+   template< class T > struct remove_rvalue_reference< const rv<T>& >         { typedef T type; };
+   template< class T > struct remove_rvalue_reference< volatile rv<T>& >      { typedef T type; };
+   template< class T > struct remove_rvalue_reference< const volatile rv<T>& >{ typedef T type; };
+#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+template <typename T>
+typename ndnboost::move_detail::add_rvalue_reference<T>::type declval();
+
+}  //move_detail {
+
+// Ideas from Boost.Move review, Jeffrey Lee Hellrung:
+//
+//- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ?
+//  Perhaps add_reference and remove_reference can be modified so that they behave wrt emulated rvalue
+//  references the same as wrt real rvalue references, i.e., add_reference< rv<T>& > -> T& rather than
+//  rv<T>& (since T&& & -> T&).
+//
+//- Add'l TypeTraits has_[trivial_]move_{constructor,assign}...?
+//
+//- An as_lvalue(T& x) function, which amounts to an identity operation in C++0x, but strips emulated
+//  rvalue references in C++03.  This may be necessary to prevent "accidental moves".
+
+
+}  //namespace ndnboost {
+
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_MOVE_TRAITS_HPP
diff --git a/ndnboost/move/utility.hpp b/ndnboost/move/utility.hpp
new file mode 100644
index 0000000..2b82879
--- /dev/null
+++ b/ndnboost/move/utility.hpp
@@ -0,0 +1,194 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_MOVE_UTILITY_HPP
+#define BOOST_MOVE_MOVE_UTILITY_HPP
+
+#include <ndnboost/move/detail/config_begin.hpp>
+#include <ndnboost/move/core.hpp>
+#include <ndnboost/move/detail/meta_utils.hpp>
+
+#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+   namespace ndnboost {
+
+   template<class T>
+   struct enable_move_utility_emulation
+   {
+      static const bool value = true;
+   };
+    
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                            move()
+   //
+   //////////////////////////////////////////////////////////////////////////////
+
+   template <class T>
+   inline typename ::ndnboost::move_detail::enable_if_c
+      < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value, T&>::type
+         move(T& x)
+   {
+      return x;
+   }
+
+   template <class T>
+   inline typename ::ndnboost::move_detail::enable_if_c
+      < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type
+         move(T& x)
+   {
+      return *static_cast<rv<T>* >(::ndnboost::move_detail::addressof(x));
+   }
+
+   template <class T>
+   inline typename ::ndnboost::move_detail::enable_if_c
+      < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type
+         move(rv<T>& x)
+   {
+      return x;
+   }
+
+   //////////////////////////////////////////////////////////////////////////////
+   //
+   //                            forward()
+   //
+   //////////////////////////////////////////////////////////////////////////////
+
+   template <class T>
+   inline typename ::ndnboost::move_detail::enable_if_c
+      < enable_move_utility_emulation<T>::value && ::ndnboost::move_detail::is_rv<T>::value, T &>::type
+         forward(const typename ::ndnboost::move_detail::identity<T>::type &x)
+   {
+      return const_cast<T&>(x);
+   }
+
+   template <class T>
+   inline typename ::ndnboost::move_detail::enable_if_c
+      < enable_move_utility_emulation<T>::value && !::ndnboost::move_detail::is_rv<T>::value, const T &>::type
+      forward(const typename ::ndnboost::move_detail::identity<T>::type &x)
+   {
+      return x;
+   }
+
+   }  //namespace ndnboost
+
+#else    //#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+   #if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
+      #include <utility>
+
+      namespace ndnboost{
+
+      using ::std::move;
+      using ::std::forward;
+
+      }  //namespace ndnboost
+
+   #else //!BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
+
+      #include <ndnboost/type_traits/remove_reference.hpp>
+
+      namespace ndnboost {
+
+      //! This trait's internal boolean `value` is false in compilers with rvalue references
+      //! and true in compilers without rvalue references.
+      //!
+      //! A user can specialize this trait for a type T to false to SFINAE out `move` and `forward`
+      //! so that the user can define a different move emulation for that type in namespace ndnboost
+      //! (e.g. another Boost library for its types) and avoid any overload ambiguity.
+      template<class T>
+      struct enable_move_utility_emulation
+      {
+         static const bool value = false;
+      };
+
+      //////////////////////////////////////////////////////////////////////////////
+      //
+      //                                  move
+      //
+      //////////////////////////////////////////////////////////////////////////////
+
+      #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
+         //! This function provides a way to convert a reference into a rvalue reference
+         //! in compilers with rvalue references. For other compilers converts T & into
+         //! <i>::ndnboost::rv<T> &</i> so that move emulation is activated.
+         template <class T>
+         rvalue_reference move (input_reference);
+
+      #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+
+         //Old move approach, lvalues could bind to rvalue references
+         template <class T>
+         inline typename remove_reference<T>::type && move(T&& t)
+         {  return t;   }
+
+      #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+
+         template <class T>
+         inline typename remove_reference<T>::type && move(T&& t)
+         { return static_cast<typename remove_reference<T>::type &&>(t); }
+
+      #endif   //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+
+      //////////////////////////////////////////////////////////////////////////////
+      //
+      //                                  forward
+      //
+      //////////////////////////////////////////////////////////////////////////////
+
+
+      #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
+         //! This function provides limited form of forwarding that is usually enough for
+         //! in-place construction and avoids the exponential overloading for
+         //! achieve the limited forwarding in C++03.
+         //!
+         //! For compilers with rvalue references this function provides perfect forwarding.
+         //!
+         //! Otherwise:
+         //! * If input_reference binds to const ::ndnboost::rv<T> & then it output_reference is
+         //!   ::ndnboost::rv<T> &
+         //!
+         //! * Else, output_reference is equal to input_reference.
+         template <class T> output_reference forward(input_reference);
+      #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+
+         //Old move approach, lvalues could bind to rvalue references
+
+         template <class T>
+         inline T&& forward (typename ::ndnboost::move_detail::identity<T>::type&& t)
+         {  return t;   }
+
+      #else //Old move
+
+         //Implementation #5 from N2951, thanks to Howard Hinnant
+
+         template <class T, class U>
+         inline T&& forward(U&& t
+             , typename ::ndnboost::move_detail::enable_if_c<
+               move_detail::is_lvalue_reference<T>::value ? move_detail::is_lvalue_reference<U>::value : true>::type * = 0/*
+             , typename ::ndnboost::move_detail::enable_if_c<
+               move_detail::is_convertible
+                  <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/)
+         { return static_cast<T&&>(t);   }
+
+      #endif   //BOOST_MOVE_DOXYGEN_INVOKED
+
+      }  //namespace ndnboost {
+
+   #endif   //#if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
+
+#endif   //BOOST_NO_CXX11_RVALUE_REFERENCES
+
+#include <ndnboost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_MOVE_UTILITY_HPP
