From f9ae459b2d8340f4baac84c5df6141f72c01ea10 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 24 Sep 2002 17:16:17 +0000 Subject: [PATCH] - Removed everything deprecated in 1.29.0 - Deprecate user use of function_base - Use the Boost Preprocessor library to make Function scalable to any (reasonable) number of arguments - Make any_pointer a POD (oops) - Test Boost.Function for 30 arguments - Remove tests of deprecated features [SVN r15498] --- doc/reference.html | 94 +- include/boost/function.hpp | 888 +----------------- .../function/detail/function_iterate.hpp | 8 + .../function/detail/gen_maybe_include.pl | 22 + .../boost/function/detail/maybe_include.hpp | 258 +++++ include/boost/function/detail/prologue.hpp | 12 + include/boost/function/function0.hpp | 38 +- include/boost/function/function1.hpp | 38 +- include/boost/function/function10.hpp | 38 +- include/boost/function/function2.hpp | 38 +- include/boost/function/function3.hpp | 37 +- include/boost/function/function4.hpp | 38 +- include/boost/function/function5.hpp | 38 +- include/boost/function/function6.hpp | 38 +- include/boost/function/function7.hpp | 38 +- include/boost/function/function8.hpp | 38 +- include/boost/function/function9.hpp | 38 +- include/boost/function/function_base.hpp | 127 +-- include/boost/function/function_template.hpp | 186 ++-- include/boost/function/gen_function_N.pl | 83 +- index.html | 5 +- test/allocator_test.cpp | 4 +- test/deprecated_syntax_test.cpp | 645 ------------- test/function_30.cpp | 16 + test/function_n_test.cpp | 2 +- test/mixin_test.cpp | 60 -- test/policy_test.cpp | 47 - 27 files changed, 509 insertions(+), 2365 deletions(-) create mode 100644 include/boost/function/detail/function_iterate.hpp create mode 100644 include/boost/function/detail/gen_maybe_include.pl create mode 100644 include/boost/function/detail/maybe_include.hpp create mode 100644 include/boost/function/detail/prologue.hpp delete mode 100644 test/deprecated_syntax_test.cpp create mode 100644 test/function_30.cpp delete mode 100644 test/mixin_test.cpp delete mode 100644 test/policy_test.cpp diff --git a/doc/reference.html b/doc/reference.html index 51d73e6..4740e4b 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -13,9 +13,8 @@
 namespace boost {
-  class function_base
+  class function_base  // Deprecated
   {
-    typedef implementation-defined safe_bool;
     bool empty() const;
   };
 
@@ -25,14 +24,13 @@
 	   typename Arg2,
            ...
            typename ArgN,
-	   typename Policy    = empty_function_policy, // Deprecated
-	   typename Mixin     = empty_function_mixin, // Deprecated
-	   typename Allocator = std::allocator<function_base> >
-  class functionN : public function_base, public Mixin
+	   typename Allocator = std::allocator<void> >
+  class functionN : public function_base
   {
+    typedef implementation-defined safe_bool;
+
+  public:
     typedef ResultType result_type; // [1]
-    typedef Policy     policy_type; // Deprecated
-    typedef Mixin      mixin_type; // Deprecated
     typedef Allocator  allocator_type;
 
     typedef Arg1 argument_type;        // If N == 1
@@ -50,17 +48,15 @@
     enum { arity = N };
 
     // Construction
-    explicit functionN(const Mixin& = Mixin());
+    explicit functionN();
     functionN(const functionN&);
-    template<typename F> functionN(F, const Mixin& = Mixin());
+    template<typename F> functionN(F);
     template<typename F> functionN(reference_wrapper<F>);
     
     // Assignment
     functionN& operator=(const functionN&);
     template<typename F> functionN& operator=(F);
     template<typename F> functionN& operator=(reference_wrapper<F>);
-    void set(const functionN&); // Deprecated
-    template<typename F> void set(F); // Deprecated
     void swap(functionN&);
     void clear();
 
@@ -77,37 +73,30 @@
 	   typename Arg2,
            ...
 	   typename ArgN,
-           typename Policy, // Deprecated
-           typename Mixin, // Deprecated
            typename Allocator>
-  void swap(functionN<ResultType, Arg1, Arg2, ..., ArgN, Policy, Mixin, Allocator>&,
-            functionN<ResultType, Arg1, Arg2, ..., ArgN, Policy, Mixin, Allocator>&);
+  void swap(functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>&,
+            functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>&);
 
   // For any N in [0, MAX_ARGS]
   template<typename Signature, // Function type: ResultType (Arg1, Arg2, ..., ArgN)
-	   typename Policy    = empty_function_policy, // Deprecated
-	   typename Mixin     = empty_function_mixin, // Deprecated
-	   typename Allocator = std::allocator<function_base> >
-  class function : public functionN<ResultType, Arg1, Arg2, ..., ArgN>
+	   typename Allocator = std::allocator<void> >
+  class function : public functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>
   {
     // Construction
     function();
     function(const function&);
-    function(const functionN<ResultType, Arg1, Arg2, ..., ArgN>&);
+    function(const functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>&);
     template<typename F> functionN(F);
     
     // Assignment
     function& operator=(const function&);
-    function& operator=(const functionN<ResultType, Arg1, Arg2, ..., ArgN>&);
+    function& operator=(const functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>&);
     template<typename F> function& operator=(F);
-    void set(const function&); // Deprecated
-    void set(const functionN<ResultType, Arg1, Arg2, ..., ArgN>&); // Deprecated
-    template<typename F> void set(F); // Deprecated
   };
 
-  template<typename Signature, typename Policy, typename Mixin, typename Allocator>
-  void swap(function<Signature, Policy, Mixin, Allocator>&,
-            function<Signature, Policy, Mixin, Allocator>&);
+  template<typename Signature, typename Allocator>
+  void swap(function<Signature, Allocator>&,
+            function<Signature, Allocator>&);
 }	   
 
@@ -141,7 +130,7 @@

Class function_base

Class function_base is the common base class for all Boost.Function objects. Objects of type function_base may not be created directly. - +

Note: the use of this class by users is deprecated. This class will become an implementation detail in the future.

bool empty() const

-

void set(const functionN& g); -

- -

template<typename F> void set(F g); -

-

void swap(functionN& g);

@@ -267,11 +241,9 @@ typename Arg2, ... typename ArgN, - typename Policy, // Deprecated - typename Mixin, // Deprecated typename Allocator> -void swap(functionN<ResultType, Arg1, Arg2, ..., ArgN, Policy, Mixin, Allocator>& f, - functionN<ResultType, Arg1, Arg2, ..., ArgN, Policy, Mixin, Allocator>& g); +void swap(functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>& f, + functionN<ResultType, Arg1, Arg2, ..., ArgN, Allocator>& g);