diff --git a/doc/function.xml b/doc/function.xml index d6fedc3..da8619e 100644 --- a/doc/function.xml +++ b/doc/function.xml @@ -3,7 +3,7 @@ "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> + xmlns:xi="http://www.w3.org/2003/XInclude"> Douglas diff --git a/doc/reference.xml b/doc/reference.xml index ce1f402..8a35974 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -83,6 +83,30 @@ Will not throw. + + + + + + Functor* + + + + const Functor* + + + If this stores a target of type + Functor, returns the address of the + target. Otherwise, returns the NULL + pointer. + + Will not throw. + + @@ -216,6 +240,30 @@ + + + + + Functor* + + + + const Functor* + + + If this stores a target of type + Functor, returns the address of the + target. Otherwise, returns the NULL + pointer. + + Will not throw. + + + result_type @@ -246,46 +294,208 @@ - - - - void - const functionN<T1, T2, ..., TN, Allocator1>& - const functionN<U1, U2, ..., UN, Allocator2>& - This function must be left undefined. - The safe_bool conversion opens a loophole whereby two function instances can be compared via ==. This undefined void operator == closes the loophole and ensures a compile-time or link-time error. - + + + + + bool + const functionN<T1, T2, ..., TN, Allocator>& + Functor + + + + bool + Functor + const functionN<T1, T2, ..., TN, Allocator>& + + + + bool + const functionN<T1, T2, ..., TN, Allocator>& + reference_wrapper<Functor> + + + + bool + reference_wrapper<Functor> + const functionN<T1, T2, ..., TN, Allocator>& + + + + void + const functionN<T1, T2, ..., TN, Allocator1>& + const functionN<U1, U2, ..., UN, Allocator2>& + - - - void - const functionN<T1, T2, ..., TN, Allocator1>& - const functionN<U1, U2, ..., UN, Allocator2>& - This function must be left undefined. - The safe_bool conversion opens a loophole whereby two function instances can be compared via !=. This undefined void operator != closes the loophole and ensures a compile-time or link-time error. - + True when f stores an object of + type Functor and one of the following conditions applies: + + + g is of type + reference_wrapper<Functor> + and f.target<Functor>() == g.get_pointer(). + + g is not of type + reference_wrapper<Functor> + and *(f.target<Functor>()) == + g. + + + + + functionN + objects are not + EqualityComparable. + + The safe_bool conversion + opens a loophole whereby two functionN + instances can be compared via ==, although this + is not feasible to implement. The undefined void + operator== closes the loophole and ensures a + compile-time or link-time error. + + + + + + bool + const functionN<T1, T2, ..., TN, Allocator>& + Functor + + + + bool + Functor + const functionN<T1, T2, ..., TN, Allocator>& + + + + bool + const functionN<T1, T2, ..., TN, Allocator>& + reference_wrapper<Functor> + + + + bool + reference_wrapper<Functor> + const functionN<T1, T2, ..., TN, Allocator>& + + + + void + const functionN<T1, T2, ..., TN, Allocator1>& + const functionN<U1, U2, ..., UN, Allocator2>& + + + True when f does not store an + object of type Functor or it stores an object of + type Functor and one of the following conditions + applies: + + + g is of type + reference_wrapper<Functor> + and f.target<Functor>() != g.get_pointer(). + + g is not of type + reference_wrapper<Functor> + and *(f.target<Functor>()) != + g. + + + + + functionN + objects are not + EqualityComparable. + + The safe_bool conversion + opens a loophole whereby two functionN + instances can be compared via !=, although this + is not feasible to implement. The undefined void + operator!= closes the loophole and ensures a + compile-time or link-time error. + @@ -441,6 +651,29 @@ + + + + + Functor* + + + + const Functor* + + + If this stores a target of type + Functor, returns the address of the + target. Otherwise, returns the NULL + pointer. + Will not throw. + + + result_type @@ -468,34 +701,172 @@ - - - - void - const function<Signature1, Allocator1>& - const function<Signature2, Allocator2>& - This function must be left undefined. - The safe_bool conversion opens a loophole whereby two function instances can be compared via ==. This undefined void operator == closes the loophole and ensures a compile-time or link-time error. - + + + + + bool + const function<Signature, Allocator>& + Functor + + + + bool + Functor + const function<Signature, Allocator>& + + + + bool + const function<Signature, Allocator>& + reference_wrapper<Functor> + + + + bool + reference_wrapper<Functor> + const function<Signature, Allocator>& + + + + void + const function<Signature1, Allocator1>& + const function<Signature2, Allocator2>& + - - - void - const function<Signature1, Allocator1>& - const function<Signature2, Allocator2>& - This function must be left undefined. - The safe_bool conversion opens a loophole whereby two function instances can be compared via !=. This undefined void operator != closes the loophole and ensures a compile-time or link-time error. - + True when f stores an object of + type Functor and one of the following conditions applies: + + + g is of type + reference_wrapper<Functor> + and f.target<Functor>() == g.get_pointer(). + + g is not of type + reference_wrapper<Functor> + and *(f.target<Functor>()) == + g. + + + + + function + objects are not + EqualityComparable. + + The safe_bool conversion + opens a loophole whereby two function + instances can be compared via ==, although this + is not feasible to implement. The undefined void + operator== closes the loophole and ensures a + compile-time or link-time error. + + + + + + bool + const function<Signature, Allocator>& + Functor + + + + bool + Functor + const function<Signature, Allocator>& + + + + bool + const function<Signature, Allocator>& + reference_wrapper<Functor> + + + + bool + reference_wrapper<Functor> + const function<Signature, Allocator>& + + + + void + const function<Signature1, Allocator1>& + const function<Signature2, Allocator2>& + + + True when f does not store an + object of type Functor or it stores an object of + type Functor and one of the following conditions + applies: + + + g is of type + reference_wrapper<Functor> + and f.target<Functor>() != g.get_pointer(). + + g is not of type + reference_wrapper<Functor> + and *(f.target<Functor>()) != + g. + + + + + function + objects are not + EqualityComparable. + + The safe_bool conversion + opens a loophole whereby two function + instances can be compared via !=, although this + is not feasible to implement. The undefined void + operator!= closes the loophole and ensures a + compile-time or link-time error. + diff --git a/doc/tests.xml b/doc/tests.xml index 6eeb45c..0afa2a8 100644 --- a/doc/tests.xml +++ b/doc/tests.xml @@ -26,6 +26,12 @@ Either Boost.Lambda does not work on the platform, or Boost.Function cannot safely be applied without the use of boost::unlambda. + + Test the operation of the + target member function and the + equality operators. + + Test the (incorrect!) use of comparisons between Boost.Function function objects. Intuitive (but incorrect!) code may compile and will give meaningless results.