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/type_traits/msvc/remove_all_extents.hpp b/ndnboost/type_traits/msvc/remove_all_extents.hpp
new file mode 100644
index 0000000..cc9e8b8
--- /dev/null
+++ b/ndnboost/type_traits/msvc/remove_all_extents.hpp
@@ -0,0 +1,47 @@
+// Copyright (C) 2004 Peder Holt
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827
+
+#include <ndnboost/type_traits/msvc/typeof.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+
+namespace ndnboost {
+ template<typename T>
+ struct remove_all_extents;
+
+ namespace detail {
+ template<bool IsArray>
+ struct remove_all_extents_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ };
+ template<>
+ struct remove_all_extents_impl_typeof<true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U[]);
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type reduced_type;
+ typedef typename remove_all_extents<reduced_type>::type type;
+ };
+ };
+ } //namespace detail
+
+ template<typename T>
+ struct remove_all_extents {
+ typedef typename ndnboost::detail::remove_all_extents_impl_typeof<
+ ndnboost::is_array<T>::value
+ >::template inner<T,remove_all_extents<T> >::type type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_all_extents,T)
+ };
+} //namespace ndnboost
+
+#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
+
diff --git a/ndnboost/type_traits/msvc/remove_const.hpp b/ndnboost/type_traits/msvc/remove_const.hpp
new file mode 100644
index 0000000..6e20040
--- /dev/null
+++ b/ndnboost/type_traits/msvc/remove_const.hpp
@@ -0,0 +1,143 @@
+// Copyright (C) 2004 Peder Holt
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828
+
+#include <ndnboost/type_traits/msvc/typeof.hpp>
+#include <ndnboost/type_traits/is_volatile.hpp>
+#include <ndnboost/type_traits/is_const.hpp>
+#include <ndnboost/type_traits/is_pointer.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+
+namespace ndnboost {
+ namespace detail {
+ template<bool IsPointer,bool IsArray,bool IsConst,bool IsVolatile>
+ struct remove_const_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type;
+ };
+ };
+ template<> //Const
+ struct remove_const_impl_typeof<false,false,true,false> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U const&(*)());
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T& type;
+ };
+ };
+ template<> //CV
+ struct remove_const_impl_typeof<false,false,true,true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U volatile,ID> test(U const volatile&(*)());
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T& type;
+ };
+ };
+ template<> //Const Pointer
+ struct remove_const_impl_typeof<true,false,true,false> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(void(*)(U const[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type[];
+ };
+ };
+ template<> //CV Pointer
+ struct remove_const_impl_typeof<true,false,true,true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U volatile,ID> test(void(*)(U const volatile[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type[];
+ };
+ };
+ template<> //Const Array
+ struct remove_const_impl_typeof<false,true,true,false> {
+ template<typename T,typename ID>
+ struct inner {
+ BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0])));
+
+ template<typename U>
+ static msvc_register_type<U[value],ID> test(void(*)(U const[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type;
+ };
+ };
+
+ template<> //CV Array
+ struct remove_const_impl_typeof<false,true,true,true> {
+ template<typename T,typename ID>
+ struct inner {
+ BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0])));
+
+ template<typename U>
+ static msvc_register_type<U volatile[value],ID> test(void(*)(U const volatile[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type;
+ };
+ };
+
+ } //namespace detail
+
+ template<typename T>
+ struct remove_const {
+ typedef ndnboost::detail::remove_const_impl_typeof<
+ ndnboost::is_pointer<T>::value,
+ ndnboost::is_array<T>::value,
+ ndnboost::is_const<T>::value,
+ ndnboost::is_volatile<T>::value
+ > remove_const_type;
+ typedef typename
+ remove_const_type::template inner<
+ typename remove_const_type::template transform_type<T>::type,
+ remove_const<T>
+ >::type
+ type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_const,T)
+ };
+}//namespace ndnboost
+
+#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828
diff --git a/ndnboost/type_traits/msvc/remove_extent.hpp b/ndnboost/type_traits/msvc/remove_extent.hpp
new file mode 100644
index 0000000..54c36bc
--- /dev/null
+++ b/ndnboost/type_traits/msvc/remove_extent.hpp
@@ -0,0 +1,43 @@
+// Copyright (C) 2004 Peder Holt
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827
+
+#include <ndnboost/type_traits/msvc/typeof.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+
+namespace ndnboost {
+ namespace detail {
+ template<bool IsArray>
+ struct remove_extent_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ };
+ template<>
+ struct remove_extent_impl_typeof<true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U[]);
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ };
+ } //namespace detail
+
+ template<typename T>
+ struct remove_extent {
+ typedef typename ndnboost::detail::remove_extent_impl_typeof<
+ ndnboost::is_array<T>::value
+ >::template inner<T,remove_extent<T> >::type type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_extent,T)
+ };
+} //namespace ndnboost
+
+#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
+
diff --git a/ndnboost/type_traits/msvc/remove_pointer.hpp b/ndnboost/type_traits/msvc/remove_pointer.hpp
new file mode 100644
index 0000000..694bef8
--- /dev/null
+++ b/ndnboost/type_traits/msvc/remove_pointer.hpp
@@ -0,0 +1,42 @@
+// Copyright (C) 2004 Peder Holt
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_POINTER_HOLT_2004_0827
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_POINTER_HOLT_2004_0827
+
+#include <ndnboost/type_traits/msvc/typeof.hpp>
+#include <ndnboost/type_traits/is_pointer.hpp>
+
+namespace ndnboost {
+ namespace detail {
+ template<int IsPointer>
+ struct remove_pointer_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ };
+ template<>
+ struct remove_pointer_impl_typeof<true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U*);
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ };
+ } //namespace detail
+
+ template<typename T>
+ struct remove_pointer {
+ typedef typename ndnboost::detail::remove_pointer_impl_typeof<
+ ndnboost::is_pointer<T>::value
+ >::template inner<T,remove_pointer<T> >::type type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_pointer,T)
+ };
+} //namespace ndnboost
+
+#endif //BOOST_TYPE_TRAITS_REMOVE_POINTER_HOLT_2004_0827
diff --git a/ndnboost/type_traits/msvc/remove_volatile.hpp b/ndnboost/type_traits/msvc/remove_volatile.hpp
new file mode 100644
index 0000000..b787bec
--- /dev/null
+++ b/ndnboost/type_traits/msvc/remove_volatile.hpp
@@ -0,0 +1,143 @@
+// Copyright (C) 2004 Peder Holt
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_VOLATILE_HOLT_2004_0828
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_VOLATILE_HOLT_2004_0828
+
+#include <ndnboost/type_traits/msvc/typeof.hpp>
+#include <ndnboost/type_traits/is_volatile.hpp>
+#include <ndnboost/type_traits/is_const.hpp>
+#include <ndnboost/type_traits/is_pointer.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+
+namespace ndnboost {
+ namespace detail {
+ template<bool IsPointer,bool IsArray,bool IsConst,bool IsVolatile>
+ struct remove_volatile_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type;
+ };
+ };
+ template<> //Volatile
+ struct remove_volatile_impl_typeof<false,false,false,true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U volatile&(*)());
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T& type;
+ };
+ };
+ template<> //CV
+ struct remove_volatile_impl_typeof<false,false,true,true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U const,ID> test(U const volatile&(*)());
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T& type;
+ };
+ };
+ template<> //Volatile Pointer
+ struct remove_volatile_impl_typeof<true,false,false,true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(void(*)(U volatile[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type[];
+ };
+ };
+ template<> //CV Pointer
+ struct remove_volatile_impl_typeof<true,false,true,true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U const,ID> test(void(*)(U const volatile[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type[];
+ };
+ };
+ template<> //Volatile Array
+ struct remove_volatile_impl_typeof<false,true,false,true> {
+ template<typename T,typename ID>
+ struct inner {
+ BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0])));
+
+ template<typename U>
+ static msvc_register_type<U[value],ID> test(void(*)(U volatile[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type;
+ };
+ };
+
+ template<> //CV Array
+ struct remove_volatile_impl_typeof<false,true,true,true> {
+ template<typename T,typename ID>
+ struct inner {
+ BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0])));
+
+ template<typename U>
+ static msvc_register_type<U const[value],ID> test(void(*)(U const volatile[]));
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ template<typename T>
+ struct transform_type {
+ typedef T type;
+ };
+ };
+
+ } //namespace detail
+
+ template<typename T>
+ struct remove_volatile {
+ typedef ndnboost::detail::remove_volatile_impl_typeof<
+ ndnboost::is_pointer<T>::value,
+ ndnboost::is_array<T>::value,
+ ndnboost::is_const<T>::value,
+ ndnboost::is_volatile<T>::value
+ > remove_volatile_type;
+ typedef typename
+ remove_volatile_type::template inner<
+ typename remove_volatile_type::template transform_type<T>::type,
+ remove_volatile<T>
+ >::type
+ type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_volatile,T)
+ };
+}//namespace ndnboost
+
+#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_VOLATILE_HOLT_2004_0828