Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76612 - in sandbox/closure/boost/functional: . overloaded_function
From: lorcaminiti_at_[hidden]
Date: 2012-01-21 13:14:00


Author: lcaminiti
Date: 2012-01-21 13:14:00 EST (Sat, 21 Jan 2012)
New Revision: 76612
URL: http://svn.boost.org/trac/boost/changeset/76612

Log:
Renaming to LocalFunction.
Text files modified:
   sandbox/closure/boost/functional/overloaded_function.hpp | 42 +++++++++++++++++++++++----------------
   sandbox/closure/boost/functional/overloaded_function/config.hpp | 15 +++++++++++--
   2 files changed, 37 insertions(+), 20 deletions(-)

Modified: sandbox/closure/boost/functional/overloaded_function.hpp
==============================================================================
--- sandbox/closure/boost/functional/overloaded_function.hpp (original)
+++ sandbox/closure/boost/functional/overloaded_function.hpp 2012-01-21 13:14:00 EST (Sat, 21 Jan 2012)
@@ -182,15 +182,16 @@
 
 This function object aggregates together calls to functions of all the
 specified function types <c>F1</c>, <c>F2</c>, etc.
-The function types must be distinct from one another and they must be specified
-following the Boost.Function preferred syntax:
+The specified function types must have distinct parameters from one another and
+they must be in the following format (which is the Boost.Function preferred
+syntax):
 @code
     result_type (argument1_type, argumgnet2_type, ...)
 @endcode
 
 In some cases, the @RefFunc{make_overloaded_function} function template can be
-used to construct the overloaded function object without explicitly specifying
-the function types.
+useful to construct the overloaded function object without explicitly
+specifying the function types.
 
 The maximum number of functions to overload is given by the
 @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
@@ -212,18 +213,19 @@
 public:
     /**
     @brief Construct the overloaded function object.
-
+
     Any function pointer, function reference, function object that can be
     converted to a <c>boost::function</c> function object can be specified as
     parameter.
     */
- overload(const boost::function<F1>&, const boost::function<F2>&, ...);
+ overloaded_function(const boost::function<F1>&,
+ const boost::function<F2>&, ...);
 
     /**
     @brief Call operator matching the signature of the function type specified
- as first template parameter.
-
- This will in turn invoke the call operator of the first function passed to
+ as 1st template parameter.
+
+ This will in turn invoke the call operator of the 1st function passed to
     the constructor.
     */
     typename boost::function_traits<F1>::result_type operator()(
@@ -233,10 +235,14 @@
 
     /**
     @brief Call operator matching the signature of the function type specified
- as second template parameter.
-
- This will in turn invoke the call operator of the second function passed to
+ as 2nd template parameter.
+
+ This will in turn invoke the call operator of the 2nd function passed to
     the constructor.
+
+ @Note Similar call operators are present for all specified function types
+ <c>F1</c>, <c>F2</c>, etc (even if not explicitly listed by this
+ documentation).
     */
     typename boost::function_traits<F2>::result_type operator()(
             typename boost::function_traits<F2>::arg1_type,
@@ -249,21 +255,23 @@
 function types.
 
 This function template creates and returns an @RefClass{overloaded_function}
-function object that overloads all the functions specified by its parameters.
+function object that overloads all the specified functions <c>f1</c>,
+<c>f2</c>, etc.
 
 The function types are internally determined from the template parameter types
 so they do not need to be explicitly specified.
-Therefore, this function template has a more concise syntax when compared to
-_at_RefClass{overloaded_function}.
+Therefore, this function template usually has a more concise syntax when
+compared with @RefClass{overloaded_function}.
 This is especially useful when the explicit type of the returned
 @RefClass{overloaded_function} does not need to be known (e.g., when used with Boost.Typeof's <c>BOOST_AUTO</c> (or C++11 <c>auto</c>) or when the overloaded
-function object is deduced using a function template parameter).
+function object is deduced using a function template parameter, see the
+@RefSect{Tutorial} section).
 
 The maximum number of functions to overload is given by the
 @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
 configuration macro.
 
-_at_Note <c>__function_type__</c> is a placeholder in this documentation for a
+@Note In this documentation, <c>__function_type__</c> is a placeholder for a
 symbol that is specific to implementation of this library.
 
 @See

Modified: sandbox/closure/boost/functional/overloaded_function/config.hpp
==============================================================================
--- sandbox/closure/boost/functional/overloaded_function/config.hpp (original)
+++ sandbox/closure/boost/functional/overloaded_function/config.hpp 2012-01-21 13:14:00 EST (Sat, 21 Jan 2012)
@@ -3,14 +3,16 @@
 #define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
 
 /** @file
-_at_brief Macros to change the compile-time configuration of this library.
+@brief Change the compile-time configuration of this library.
 */
 
 /**
 @brief Specify the maximum number of arguments of the functions being
 overloaded.
 
-If this macro is left undefined by the user, it has a default value of 5.
+If this macro is left undefined by the user, it has a default value of 5
+(increasing this number might increase compilation time).
+When specified by the user, this macro must be a non-negative integer number.
 
 @See
     @RefSectId{Getting_Started, Getting Started},
@@ -23,7 +25,11 @@
 /**
 @brief Specify the maximum number of functions that can be overloaded.
 
-If this macro is left undefined by the user, it has a default value of 5.
+If this macro is left undefined by the user, it has a default value of 5
+(increasing this number might increase compilation time).
+When defined by the user, this macro must be an integer number greater or
+equal than 2 (because at least two distinct functions need to be specified in
+order to define an overload).
 
 @See
     @RefSectId{Getting_Started, Getting Started},
@@ -32,6 +38,9 @@
 #ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
 #define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX 5
 #endif
+#if BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX < 2
+#error "BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX must be >= 2"
+#endif
 
 #endif // #include guard
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk