Forcing type-of emulation on Sun.

Trying to fix OverloadedFunction pp bug on Sun by removing SUB on iteration range (doing ADD on iteration index instead).

[SVN r77940]
This commit is contained in:
Lorenzo Caminiti
2012-04-12 21:12:28 +00:00
parent 094516d686
commit 90b94a9560
5 changed files with 14 additions and 14 deletions

View File

@ -24,6 +24,7 @@
# include <boost/preprocessor/comparison/less.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/arithmetic/add.hpp>
# include <boost/preprocessor/arithmetic/sub.hpp>
# include <boost/preprocessor/tuple/eat.hpp>
# include <boost/preprocessor/logical/and.hpp>
# include <boost/preprocessor/logical/not.hpp>
@ -82,14 +83,10 @@
BOOST_FUNCTIONAL_f_type(z, n, ~) \
>::type
// Iterate within namespace.
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_OVERLOAD_COUNT \
/*at least 2 func to overload 2, 3, ...*/ \
BOOST_PP_SUB( \
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
2)
# define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_OVERLOAD_COUNT, \
/* at least 2 func to overload so start from 2 to MAX */ \
/* (cannot iterate [0, MAX-2) because error on Sun) */ \
(3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
"boost/functional/overloaded_function.hpp"))
# include BOOST_PP_ITERATE() // Iterate over function arity.
@ -113,8 +110,10 @@
#elif BOOST_PP_ITERATION_DEPTH() == 1
# define BOOST_FUNCTIONAL_overloads \
/* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
BOOST_PP_SUB(BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
BOOST_PP_FRAME_ITERATION(1))
/* (add 2 because iteration started from 2 to MAX) */ \
BOOST_PP_ADD(2, BOOST_PP_SUB( \
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
BOOST_PP_FRAME_ITERATION(1)))
# define BOOST_FUNCTIONAL_is_tspec \
/* if template specialization */ \
BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \

View File

@ -10,7 +10,7 @@
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
# include <boost/functional/overloaded_function/config.hpp>
/**@todo# include <boost/function.hpp>*/
# include <boost/function.hpp>
# include <boost/preprocessor/iteration/iterate.hpp>
# include <boost/preprocessor/repetition/enum.hpp>
# include <boost/preprocessor/cat.hpp>
@ -39,12 +39,10 @@ namespace boost { namespace overloaded_function_detail {
template<typename F>
class base {}; // Empty template cannot be used directly (only its spec).
/*@todo
# define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
"boost/functional/overloaded_function/detail/base.hpp"))
# include BOOST_PP_ITERATE() // Iterate over funciton arity.
*/
} } // namespace

View File

@ -16,7 +16,7 @@
#include <boost/function_types/result_type.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/type_traits/remove_reference.hpp>
/** @todo #include <boost/function.hpp>*/
#include <boost/function.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/pop_front.hpp>

View File

@ -7,6 +7,9 @@
import testing ;
# Sun does not automatically detect type-of emulation (force it).
project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
run functor.cpp ;
run make_decl.cpp ;
run make_call.cpp ;

View File

@ -8,10 +8,10 @@
#ifndef IDENTITY_HPP_
#define IDENTITY_HPP_
/** @todo #include <boost/function.hpp> */
//[identity_typeof
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
//]
#include <boost/function.hpp>
#include <string>
//[identity_decls