Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77485 - trunk/boost/local_function/aux_
From: lorcaminiti_at_[hidden]
Date: 2012-03-22 17:03:40


Author: lcaminiti
Date: 2012-03-22 17:03:40 EDT (Thu, 22 Mar 2012)
New Revision: 77485
URL: http://svn.boost.org/trac/boost/changeset/77485

Log:
LocalFunction now using newly added Boost.Config's BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS.
Text files modified:
   trunk/boost/local_function/aux_/config.hpp | 19 +++++--------------
   1 files changed, 5 insertions(+), 14 deletions(-)

Modified: trunk/boost/local_function/aux_/config.hpp
==============================================================================
--- trunk/boost/local_function/aux_/config.hpp (original)
+++ trunk/boost/local_function/aux_/config.hpp 2012-03-22 17:03:40 EDT (Thu, 22 Mar 2012)
@@ -10,22 +10,13 @@
 
 #include <boost/config.hpp>
 
-// PRIVATE //
-
-// FUTURE: Replace this with BOOST_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS after
-// that macro is added to Boost.Config.
-// If it is possible to pass local types (classes, etc) as template parameters.
-// This is not possible in pure C++03 but it is possible in some C++03
-// extensions (MSVC, GCC 4.5.x, etc).
-#if !((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) && \
- defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(BOOST_MSVC)
- // Not GCC 4.5.x with -std=c++0x and not MSVC.
-# define BOOST_LOCAL_FUNCTION_AUX_CONFIG_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS
-#endif
-
 // PUBLIC //
 
-#ifdef BOOST_LOCAL_FUNCTION_AUX_CONFIG_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS
+// NOTE: If local classes can be passes as template parameters (always true for
+// C++11 and true for some C++03 compilers like MSVC and old GCC versions),
+// this library uses it to optimize local function performances (which in this
+// case are comparable to C++11 lambdas).
+#ifdef BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
 # define BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01 0
 #else
 # define BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01 1


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