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/functional/factory/test/factory.cpp b/libs/functional/factory/test/factory.cpp
new file mode 100644
index 0000000..4d47f28
--- /dev/null
+++ b/libs/functional/factory/test/factory.cpp
@@ -0,0 +1,36 @@
+/*=============================================================================
+ Copyright (c) 2007 Tobias Schwinger
+
+ Use modification and distribution are 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).
+==============================================================================*/
+
+#include <boost/functional/factory.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <memory>
+
+class sum
+{
+ int val_sum;
+ public:
+ sum(int a, int b) : val_sum(a + b) { }
+
+ operator int() const { return this->val_sum; }
+};
+
+int main()
+{
+ int one = 1, two = 2;
+ {
+ sum* instance( ndnboost::factory< sum* >()(one,two) );
+ BOOST_TEST(*instance == 3);
+ }
+ {
+ std::auto_ptr<sum> instance( ndnboost::factory< std::auto_ptr<sum> >()(one,two) );
+ BOOST_TEST(*instance == 3);
+ }
+ return ndnboost::report_errors();
+}
+