Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71845 - in sandbox/local: boost/local boost/local/aux_ libs/local/example
From: lorcaminiti_at_[hidden]
Date: 2011-05-09 12:50:24


Author: lcaminiti
Date: 2011-05-09 12:50:23 EDT (Mon, 09 May 2011)
New Revision: 71845
URL: http://svn.boost.org/trac/boost/changeset/71845

Log:
Added overloading source and examples.
Text files modified:
   sandbox/local/boost/local/aux_/file.hpp | 7 +++++--
   sandbox/local/boost/local/aux_/function.hpp | 15 +++++----------
   sandbox/local/boost/local/config.hpp | 29 +++++++++++++++++++++++++++--
   sandbox/local/libs/local/example/Jamfile.jam | 3 +++
   4 files changed, 40 insertions(+), 14 deletions(-)

Modified: sandbox/local/boost/local/aux_/file.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/file.hpp (original)
+++ sandbox/local/boost/local/aux_/file.hpp 2011-05-09 12:50:23 EDT (Mon, 09 May 2011)
@@ -7,8 +7,11 @@
 #ifndef BOOST_LOCAL_AUX_FILE_HPP_
 #define BOOST_LOCAL_AUX_FILE_HPP_
 
-#define BOOST_LOCAL_AUX_FILE_ABSTRACT_FUNCTION_HPP \
- "boost/local/aux_/abstract_function.hpp"
+#define BOOST_LOCAL_AUX_FILE_FUNCTION_OVERLOAD_HPP \
+ "boost/local/function/overload.hpp"
+
+#define BOOST_LOCAL_AUX_FILE_OVERLOAD_BASE_HPP \
+ "boost/local/aux_/overload_base.hpp"
 
 #define BOOST_LOCAL_AUX_FILE_FUNCTION_HPP \
     "boost/local/aux_/function.hpp"

Modified: sandbox/local/boost/local/aux_/function.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/function.hpp (original)
+++ sandbox/local/boost/local/aux_/function.hpp 2011-05-09 12:50:23 EDT (Mon, 09 May 2011)
@@ -87,13 +87,13 @@
     // Empty template cannot be used directly (only via its specializations).
 };
 
-}}} // namespace boost::loca::aux
-
-// Iteration within the namespace.
+// Iterate within namespace.
 # define BOOST_PP_ITERATION_PARAMS_1 \
                 (3, (0, BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX, \
                 BOOST_LOCAL_AUX_FILE_FUNCTION_HPP))
-# include BOOST_PP_ITERATE() // Iterate over arity.
+# include BOOST_PP_ITERATE() // Iterate over function arity.
+
+}}} // namespace boost::loca::aux
 
 #undef BOOST_LOCAL_AUX_arg_type
 #undef BOOST_LOCAL_AUX_arg_param_type
@@ -113,7 +113,6 @@
 
 #elif BOOST_PP_ITERATION_DEPTH() == 1
 # define BOOST_LOCAL_AUX_arity BOOST_PP_FRAME_ITERATION(1)
-
 # define BOOST_PP_ITERATION_PARAMS_2 \
             (3, (0, BOOST_LOCAL_AUX_arity, \
             BOOST_LOCAL_AUX_FILE_FUNCTION_HPP))
@@ -123,8 +122,7 @@
 #elif BOOST_PP_ITERATION_DEPTH() == 2
 # define BOOST_LOCAL_AUX_defaults BOOST_PP_FRAME_ITERATION(2)
 
-namespace boost { namespace local { namespace aux {
-
+// Iterating within namespce boost::local::aux.
 template<typename R
     BOOST_PP_COMMA_IF(BOOST_LOCAL_AUX_arity)
     BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity, BOOST_LOCAL_AUX_arg_tparam, ~)
@@ -182,9 +180,6 @@
     void* unused_;
 };
 
-}}} // namespace boost::local::aux
-
 # undef BOOST_LOCAL_AUX_defaults
-
 #endif // iteration
 

Modified: sandbox/local/boost/local/config.hpp
==============================================================================
--- sandbox/local/boost/local/config.hpp (original)
+++ sandbox/local/boost/local/config.hpp 2011-05-09 12:50:23 EDT (Mon, 09 May 2011)
@@ -75,13 +75,37 @@
  *
  * @Warning Increasing this number will increase compilation time.
  *
- * @See @RefSect2{Getting_Started, Getting Started} section.
+ * @See @RefSect{Tutorial} section, @RefSect2{Getting_Started, Getting Started}
+ * section.
  */
 #ifndef BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX
 #define BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX 5
 #endif
 
 /**
+ * @brief The number of times a function can be overloaded.
+ *
+ * If programmers leave this configuration macro undefined, its default
+ * value is <c>6</c>.
+ *
+ * This number must be greater or equal than 2 (because a single function
+ * cannot be overloaded by itself) otherwise the library will generate a
+ * compile-time error.
+ *
+ * @Warning Increasing this number will increase compilation time when the
+ * header file <c>"boost/local/function/overload.hpp"</c> is included.
+ *
+ * @See @RefSect2{Advanced_Topics, Advanced Topics} section,
+ * @RefSect2{Getting_Started, Getting Started} section.
+ */
+#ifndef BOOST_LOCAL_CONFIG_OVERLOADS
+#define BOOST_LOCAL_CONFIG_OVERLOADS 6
+#endif
+#if BOOST_LOCAL_CONFIG_OVERLOADS < 2
+#error "BOOST_LOCAL_CONFIG_OVERLOADS must be a number grater or equal than 2"
+#endif
+
+/**
  * @brief The name of the special symbol used to access the bound object
  * <c>this</c>.
  *
@@ -93,7 +117,8 @@
  * changed). Changing the symbol <c>this_</c> effectively changes the public
  * API of this library.
  *
- * @See @RefSect2{Getting_Started, Getting Started} section.
+ * @See @RefSect{Tutorial} section, @RefSect2{Getting_Started, Getting Started}
+ * section.
  */
 #ifndef BOOST_LOCAL_CONFIG_THIS_PARAM_NAME
 #define BOOST_LOCAL_CONFIG_THIS_PARAM_NAME this_

Modified: sandbox/local/libs/local/example/Jamfile.jam
==============================================================================
--- sandbox/local/libs/local/example/Jamfile.jam (original)
+++ sandbox/local/libs/local/example/Jamfile.jam 2011-05-09 12:50:23 EDT (Mon, 09 May 2011)
@@ -87,6 +87,9 @@
 exe print_map : print_map.cpp ;
 exe print_map_va : print_map_va.cpp ;
 
+exe overload : overload.cpp ;
+exe overload_va : overload_va.cpp ;
+
 exe profile_boost_local : profile_boost_local.cpp
         ../../..//libboost_chrono ../../..//libboost_system ;
 exe profile_boost_local_inline : profile_boost_local_inline.cpp


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