In common.h, define func_lib for function objects.  In configure.ac, define HAVE_STD_FUNCTION and HAVE_BOOST_FUNCTION.  Include function headers in ndnboost.
diff --git a/ndnboost/utility/addressof.hpp b/ndnboost/utility/addressof.hpp
index 8eddab4..20d5b8c 100644
--- a/ndnboost/utility/addressof.hpp
+++ b/ndnboost/utility/addressof.hpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2002 Brad King (brad.king@kitware.com) 
+// Copyright (C) 2002 Brad King (brad.king@kitware.com)
 //                    Douglas Gregor (gregod@cs.rpi.edu)
 //
 // Copyright (C) 2002, 2008 Peter Dimov
@@ -50,7 +50,7 @@
 
 template<class T> T * addressof( T & v )
 {
-#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) )
+#if (defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) ) ) || defined( __SUNPRO_CC )
 
     return ndnboost::detail::addressof_impl<T>::f( v, 0 );
 
diff --git a/ndnboost/utility/declval.hpp b/ndnboost/utility/declval.hpp
new file mode 100644
index 0000000..c22154c
--- /dev/null
+++ b/ndnboost/utility/declval.hpp
@@ -0,0 +1,49 @@
+//  common_type.hpp  ---------------------------------------------------------//
+
+//  Copyright 2010 Vicente J. Botet Escriba
+
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
+#define BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
+
+#include <ndnboost/config.hpp>
+
+//----------------------------------------------------------------------------//
+
+#include <ndnboost/type_traits/add_rvalue_reference.hpp>
+//#include <ndnboost/type_traits/add_lvalue_reference.hpp>
+
+//----------------------------------------------------------------------------//
+//                                                                            //
+//                           C++03 implementation of                          //
+//                          Written by Vicente J. Botet Escriba               //
+//~ 20.3.4 Function template declval [declval]
+//~ 1 The library provides the function template declval to simplify the definition of expressions which occur as
+//~ unevaluated operands.
+//~ 2 Remarks: If this function is used, the program is ill-formed.
+//~ 3 Remarks: The template parameter T of declval may be an incomplete type.
+//~ [ Example:
+
+//~ template <class To, class From>
+//~ decltype(static_cast<To>(declval<From>())) convert(From&&);
+
+//~ declares a function template convert which only participats in overloading if the type From can be
+//~ explicitly converted to type To. For another example see class template common_type (20.7.6.6). —end
+//~ example ]
+//                                                                            //
+//----------------------------------------------------------------------------//
+
+namespace ndnboost {
+
+//#if !defined(BOOST_NO_RVALUE_REFERENCES)
+    template <typename T>
+    typename add_rvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
+//#else
+//    template <typename T>
+//    typename add_lvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
+//#endif
+}  // namespace ndnboost
+
+#endif  // BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
diff --git a/ndnboost/utility/detail/result_of_iterate.hpp b/ndnboost/utility/detail/result_of_iterate.hpp
new file mode 100644
index 0000000..3a9dc3f
--- /dev/null
+++ b/ndnboost/utility/detail/result_of_iterate.hpp
@@ -0,0 +1,208 @@
+// Boost result_of library
+
+//  Copyright Douglas Gregor 2004. Use, modification and
+//  distribution is subject to 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)
+
+//  Copyright Daniel Walker, Eric Niebler, Michel Morin 2008-2012.
+//  Use, modification and distribution is subject to 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)
+
+// For more information, see http://www.boost.org/libs/utility
+#if !defined(BOOST_PP_IS_ITERATING)
+# error Boost result_of - do not include this file!
+#endif
+
+// CWPro8 requires an argument in a function type specialization
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3002)) && BOOST_PP_ITERATION() == 0
+# define BOOST_RESULT_OF_ARGS void
+#else
+# define BOOST_RESULT_OF_ARGS BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)
+#endif
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of<F(BOOST_RESULT_OF_ARGS)>
+    : mpl::if_<
+          mpl::or_< is_pointer<F>, is_member_function_pointer<F> >
+        , ndnboost::detail::tr1_result_of_impl<
+            typename remove_cv<F>::type,
+            typename remove_cv<F>::type(BOOST_RESULT_OF_ARGS),
+            (ndnboost::detail::has_result_type<F>::value)>
+        , ndnboost::detail::tr1_result_of_impl<
+            F,
+            F(BOOST_RESULT_OF_ARGS),
+            (ndnboost::detail::has_result_type<F>::value)> >::type { };
+#endif
+
+#ifdef BOOST_RESULT_OF_USE_DECLTYPE
+
+// Uses declval following N3225 20.7.7.6 when F is not a pointer.
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct result_of<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))>
+    : mpl::if_<
+          is_member_function_pointer<F>
+        , detail::tr1_result_of_impl<
+            typename remove_cv<F>::type,
+            typename remove_cv<F>::type(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false
+          >
+        , detail::cpp0x_result_of_impl<
+              F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))
+          >
+      >::type
+{};
+
+namespace detail {
+
+#ifdef BOOST_NO_SFINAE_EXPR
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION());
+
+template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename T)>
+struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T))> {
+    R operator()(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T)) const;
+    typedef result_of_private_type const &(*pfn_t)(...);
+    operator pfn_t() const volatile;
+};
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION());
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F *>
+  : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
+{};
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F &>
+  : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
+{};
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_select_call_wrapper_type_, BOOST_PP_ITERATION())
+  : mpl::eval_if<
+        is_class<typename remove_reference<F>::type>,
+        result_of_wrap_callable_class<F>,
+        mpl::identity<BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> >
+    >
+{};
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename T)>
+struct BOOST_PP_CAT(result_of_is_callable_, BOOST_PP_ITERATION()) {
+    typedef typename BOOST_PP_CAT(result_of_select_call_wrapper_type_, BOOST_PP_ITERATION())<F>::type wrapper_t;
+    static const bool value = (
+        sizeof(result_of_no_type) == sizeof(detail::result_of_is_private_type(
+            (ndnboost::declval<wrapper_t>()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ndnboost::declval<T, >() BOOST_PP_INTERCEPT)), result_of_weird_type())
+        ))
+    );
+    typedef mpl::bool_<value> type;
+};
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), true>
+    : lazy_enable_if<
+          BOOST_PP_CAT(result_of_is_callable_, BOOST_PP_ITERATION())<F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), T)>
+        , cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false>
+      >
+{};
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false>
+{
+  typedef decltype(
+    ndnboost::declval<F>()(
+      BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ndnboost::declval<T, >() BOOST_PP_INTERCEPT)
+    )
+  ) type;
+};
+
+#else // BOOST_NO_SFINAE_EXPR
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)),
+                            typename result_of_always_void<decltype(
+                                ndnboost::declval<F>()(
+                                    BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ndnboost::declval<T, >() BOOST_PP_INTERCEPT)
+                                )
+                            )>::type> {
+  typedef decltype(
+    ndnboost::declval<F>()(
+      BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ndnboost::declval<T, >() BOOST_PP_INTERCEPT)
+    )
+  ) type;
+};
+
+#endif // BOOST_NO_SFINAE_EXPR
+
+} // namespace detail
+
+#else // defined(BOOST_RESULT_OF_USE_DECLTYPE)
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct result_of<F(BOOST_RESULT_OF_ARGS)>
+    : tr1_result_of<F(BOOST_RESULT_OF_ARGS)> { };
+#endif
+
+#endif // defined(BOOST_RESULT_OF_USE_DECLTYPE)
+
+#undef BOOST_RESULT_OF_ARGS
+
+#if BOOST_PP_ITERATION() >= 1
+
+namespace detail {
+
+template<typename R,  typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
+{
+  typedef R type;
+};
+
+template<typename R,  typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
+{
+  typedef R type;
+};
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)),
+                 FArgs, false>
+{
+  typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
+                     const,
+                 FArgs, false>
+{
+  typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
+                     volatile,
+                 FArgs, false>
+{
+  typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
+                     const volatile,
+                 FArgs, false>
+{
+  typedef R type;
+};
+#endif
+
+}
+#endif
diff --git a/ndnboost/utility/enable_if.hpp b/ndnboost/utility/enable_if.hpp
new file mode 100644
index 0000000..85ed292
--- /dev/null
+++ b/ndnboost/utility/enable_if.hpp
@@ -0,0 +1,119 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to 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)
+
+//    Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+//             Jeremiah Willcock (jewillco at osl.iu.edu)
+//             Andrew Lumsdaine (lums at osl.iu.edu)
+
+
+#ifndef BOOST_UTILITY_ENABLE_IF_HPP
+#define BOOST_UTILITY_ENABLE_IF_HPP
+
+#include "ndnboost/config.hpp"
+
+// Even the definition of enable_if causes problems on some compilers,
+// so it's macroed out for all compilers that do not support SFINAE
+
+#ifndef BOOST_NO_SFINAE
+
+namespace ndnboost
+{
+ 
+  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 <bool B, class T>
+  struct lazy_enable_if_c {
+    typedef typename T::type type;
+  };
+
+  template <class T>
+  struct lazy_enable_if_c<false, T> {};
+
+  template <class Cond, class T> 
+  struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
+
+
+  template <bool B, class T = void>
+  struct disable_if_c {
+    typedef T type;
+  };
+
+  template <class T>
+  struct disable_if_c<true, T> {};
+
+  template <class Cond, class T = void> 
+  struct disable_if : public disable_if_c<Cond::value, T> {};
+
+  template <bool B, class T>
+  struct lazy_disable_if_c {
+    typedef typename T::type type;
+  };
+
+  template <class T>
+  struct lazy_disable_if_c<true, T> {};
+
+  template <class Cond, class T> 
+  struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
+
+} // namespace ndnboost
+
+#else
+
+namespace ndnboost {
+
+  namespace detail { typedef void enable_if_default_T; }
+
+  template <typename T>
+  struct enable_if_does_not_work_on_this_compiler;
+
+  template <bool B, class T = detail::enable_if_default_T>
+  struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <bool B, class T = detail::enable_if_default_T> 
+  struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <bool B, class T = detail::enable_if_default_T> 
+  struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <bool B, class T = detail::enable_if_default_T> 
+  struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <class Cond, class T = detail::enable_if_default_T> 
+  struct enable_if : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <class Cond, class T = detail::enable_if_default_T> 
+  struct disable_if : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <class Cond, class T = detail::enable_if_default_T> 
+  struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+  template <class Cond, class T = detail::enable_if_default_T> 
+  struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
+  { };
+
+} // namespace ndnboost
+
+#endif // BOOST_NO_SFINAE
+
+#endif
diff --git a/ndnboost/utility/result_of.hpp b/ndnboost/utility/result_of.hpp
new file mode 100644
index 0000000..7cc2ec6
--- /dev/null
+++ b/ndnboost/utility/result_of.hpp
@@ -0,0 +1,194 @@
+// Boost result_of library
+
+//  Copyright Douglas Gregor 2004. Use, modification and
+//  distribution is subject to 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)
+
+// For more information, see http://www.boost.org/libs/utility
+#ifndef BOOST_RESULT_OF_HPP
+#define BOOST_RESULT_OF_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/iteration/iterate.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <ndnboost/preprocessor/facilities/intercept.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/mpl/has_xxx.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/eval_if.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/mpl/or.hpp>
+#include <ndnboost/type_traits/is_class.hpp>
+#include <ndnboost/type_traits/is_pointer.hpp>
+#include <ndnboost/type_traits/is_member_function_pointer.hpp>
+#include <ndnboost/type_traits/remove_cv.hpp>
+#include <ndnboost/type_traits/remove_reference.hpp>
+#include <ndnboost/utility/declval.hpp>
+#include <ndnboost/utility/enable_if.hpp>
+
+#ifndef BOOST_RESULT_OF_NUM_ARGS
+#  define BOOST_RESULT_OF_NUM_ARGS 16
+#endif
+
+// Use the decltype-based version of result_of by default if the compiler
+// supports N3276 <http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3276.pdf>.
+// The user can force the choice by defining either BOOST_RESULT_OF_USE_DECLTYPE or
+// BOOST_RESULT_OF_USE_TR1, but not both!
+#if defined(BOOST_RESULT_OF_USE_DECLTYPE) && defined(BOOST_RESULT_OF_USE_TR1)
+#  error Both BOOST_RESULT_OF_USE_DECLTYPE and BOOST_RESULT_OF_USE_TR1 cannot be defined at the same time.
+#endif
+
+#ifndef BOOST_RESULT_OF_USE_TR1
+#  ifndef BOOST_RESULT_OF_USE_DECLTYPE
+#    ifndef BOOST_NO_CXX11_DECLTYPE_N3276 // this implies !defined(BOOST_NO_CXX11_DECLTYPE)
+#      define BOOST_RESULT_OF_USE_DECLTYPE
+#    else
+#      define BOOST_RESULT_OF_USE_TR1
+#    endif
+#  endif
+#endif
+
+namespace ndnboost {
+
+template<typename F> struct result_of;
+template<typename F> struct tr1_result_of; // a TR1-style implementation of result_of
+
+#if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+namespace detail {
+
+BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+
+template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_impl;
+
+#ifdef BOOST_NO_SFINAE_EXPR
+
+// There doesn't seem to be any other way to turn this off such that the presence of
+// the user-defined operator,() below doesn't cause spurious warning all over the place,
+// so unconditionally turn it off.
+#if BOOST_MSVC
+#  pragma warning(disable: 4913) // user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used
+#endif
+
+struct result_of_private_type {};
+
+struct result_of_weird_type {
+  friend result_of_private_type operator,(result_of_private_type, result_of_weird_type);
+};
+
+typedef char result_of_yes_type;      // sizeof(result_of_yes_type) == 1
+typedef char (&result_of_no_type)[2]; // sizeof(result_of_no_type)  == 2
+
+template<typename T>
+result_of_no_type result_of_is_private_type(T const &);
+result_of_yes_type result_of_is_private_type(result_of_private_type);
+
+template<typename C>
+struct result_of_callable_class : C {
+    result_of_callable_class();
+    typedef result_of_private_type const &(*pfn_t)(...);
+    operator pfn_t() const volatile;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class {
+  typedef result_of_callable_class<C> type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C const> {
+  typedef result_of_callable_class<C> const type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C volatile> {
+  typedef result_of_callable_class<C> volatile type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C const volatile> {
+  typedef result_of_callable_class<C> const volatile type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C &> {
+  typedef typename result_of_wrap_callable_class<C>::type &type;
+};
+
+template<typename F, bool TestCallability = true> struct cpp0x_result_of_impl;
+
+#else // BOOST_NO_SFINAE_EXPR
+
+template<typename T>
+struct result_of_always_void
+{
+  typedef void type;
+};
+
+template<typename F, typename Enable = void> struct cpp0x_result_of_impl {};
+
+#endif // BOOST_NO_SFINAE_EXPR
+
+template<typename F>
+struct result_of_void_impl
+{
+  typedef void type;
+};
+
+template<typename R>
+struct result_of_void_impl<R (*)(void)>
+{
+  typedef R type;
+};
+
+template<typename R>
+struct result_of_void_impl<R (&)(void)>
+{
+  typedef R type;
+};
+
+// Determine the return type of a function pointer or pointer to member.
+template<typename F, typename FArgs>
+struct result_of_pointer
+  : tr1_result_of_impl<typename remove_cv<F>::type, FArgs, false> { };
+
+template<typename F, typename FArgs>
+struct tr1_result_of_impl<F, FArgs, true>
+{
+  typedef typename F::result_type type;
+};
+
+template<typename FArgs>
+struct is_function_with_no_args : mpl::false_ {};
+
+template<typename F>
+struct is_function_with_no_args<F(void)> : mpl::true_ {};
+
+template<typename F, typename FArgs>
+struct result_of_nested_result : F::template result<FArgs>
+{};
+
+template<typename F, typename FArgs>
+struct tr1_result_of_impl<F, FArgs, false>
+  : mpl::if_<is_function_with_no_args<FArgs>,
+             result_of_void_impl<F>,
+             result_of_nested_result<F, FArgs> >::type
+{};
+
+} // end namespace detail
+
+#define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<ndnboost/utility/detail/result_of_iterate.hpp>))
+#include BOOST_PP_ITERATE()
+
+#else
+#  define BOOST_NO_RESULT_OF 1
+#endif
+
+}
+
+#endif // BOOST_RESULT_OF_HPP
diff --git a/ndnboost/utility/swap.hpp b/ndnboost/utility/swap.hpp
new file mode 100644
index 0000000..6f4e366
--- /dev/null
+++ b/ndnboost/utility/swap.hpp
@@ -0,0 +1,55 @@
+// Copyright (C) 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker
+//
+// 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)
+// For more information, see http://www.boost.org
+
+
+#ifndef BOOST_UTILITY_SWAP_HPP
+#define BOOST_UTILITY_SWAP_HPP
+
+// Note: the implementation of this utility contains various workarounds:
+// - swap_impl is put outside the boost namespace, to avoid infinite
+// recursion (causing stack overflow) when swapping objects of a primitive
+// type.
+// - swap_impl has a using-directive, rather than a using-declaration,
+// because some compilers (including MSVC 7.1, Borland 5.9.3, and
+// Intel 8.1) don't do argument-dependent lookup when it has a
+// using-declaration instead.
+// - ndnboost::swap has two template arguments, instead of one, to
+// avoid ambiguity when swapping objects of a Boost type that does
+// not have its own ndnboost::swap overload.
+
+#include <algorithm> //for std::swap
+#include <cstddef> //for std::size_t
+
+namespace ndnboost_swap_impl
+{
+  template<class T>
+  void swap_impl(T& left, T& right)
+  {
+    using namespace std;//use std::swap if argument dependent lookup fails
+    swap(left,right);
+  }
+
+  template<class T, std::size_t N>
+  void swap_impl(T (& left)[N], T (& right)[N])
+  {
+    for (std::size_t i = 0; i < N; ++i)
+    {
+      ::ndnboost_swap_impl::swap_impl(left[i], right[i]);
+    }
+  }
+}
+
+namespace ndnboost
+{
+  template<class T1, class T2>
+  void swap(T1& left, T2& right)
+  {
+    ::ndnboost_swap_impl::swap_impl(left, right);
+  }
+}
+
+#endif