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/config/compiler/gcc.hpp b/ndnboost/config/compiler/gcc.hpp
index c0ac30a..b3d12ec 100644
--- a/ndnboost/config/compiler/gcc.hpp
+++ b/ndnboost/config/compiler/gcc.hpp
@@ -11,7 +11,14 @@
 
 //  See http://www.boost.org for most recent version.
 
-//  GNU C++ compiler setup:
+//  GNU C++ compiler setup.
+
+//
+// Define BOOST_GCC so we know this is "real" GCC and not some pretender:
+//
+#if !defined(__CUDACC__)
+#define BOOST_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif
 
 #if __GNUC__ < 3
 #   if __GNUC_MINOR__ == 91
@@ -147,9 +154,16 @@
 #endif
 
 //
-// Recent GCC versions have __int128 when in 64-bit mode:
+// Recent GCC versions have __int128 when in 64-bit mode.
 //
-#if defined(__SIZEOF_INT128__)
+// We disable this if the compiler is really nvcc as it
+// doesn't actually support __int128 as of CUDA_VERSION=5000
+// even though it defines __SIZEOF_INT128__.  
+// See https://svn.boost.org/trac/boost/ticket/8048
+// Only re-enable this for nvcc if you're absolutely sure
+// of the circumstances under which it's supported:
+//
+#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
 #  define BOOST_HAS_INT128
 #endif
 
@@ -222,12 +236,18 @@
 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
 #endif
 
+// C++0x features in 4.7.n and later
+//
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #  define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#  define BOOST_NO_CXX11_USER_DEFINED_LITERALS
 #endif
-// C++0x features not supported at all yet
+
+// C++0x features in 4.8.1 and later
 //
-#define BOOST_NO_CXX11_DECLTYPE_N3276
+#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
 
 #ifndef BOOST_COMPILER
 #  define BOOST_COMPILER "GNU C++ version " __VERSION__