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/libs/function/test/mem_fun_portable.cpp b/libs/function/test/mem_fun_portable.cpp
new file mode 100644
index 0000000..af8f75f
--- /dev/null
+++ b/libs/function/test/mem_fun_portable.cpp
@@ -0,0 +1,37 @@
+// Function library
+
+// Copyright (C) 2001-2003 Douglas Gregor
+
+// 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/
+
+    
+#include <boost/function.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <iostream>
+#include <functional>
+
+struct X {
+  int foo(int);
+  std::ostream& foo2(std::ostream&) const;
+};
+int X::foo(int x) { return -x; }
+std::ostream& X::foo2(std::ostream& x) const { return x; }
+
+int main()
+{
+    ndnboost::function2<int, X*, int> f;
+    ndnboost::function2<std::ostream&, X*, std::ostream&> f2;
+
+    f = &X::foo;
+    f2 = &X::foo2;
+
+    X x;
+    BOOST_TEST(f(&x, 5) == -5);
+    BOOST_TEST(f2(&x, ndnboost::ref(std::cout)) == std::cout);
+
+    return ::ndnboost::report_errors();
+}