mirror of
https://github.com/boostorg/functional.git
synced 2025-07-30 20:47:17 +02:00
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:
@ -24,6 +24,7 @@
|
|||||||
# include <boost/preprocessor/comparison/less.hpp>
|
# include <boost/preprocessor/comparison/less.hpp>
|
||||||
# include <boost/preprocessor/cat.hpp>
|
# include <boost/preprocessor/cat.hpp>
|
||||||
# include <boost/preprocessor/arithmetic/add.hpp>
|
# include <boost/preprocessor/arithmetic/add.hpp>
|
||||||
|
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||||
# include <boost/preprocessor/tuple/eat.hpp>
|
# include <boost/preprocessor/tuple/eat.hpp>
|
||||||
# include <boost/preprocessor/logical/and.hpp>
|
# include <boost/preprocessor/logical/and.hpp>
|
||||||
# include <boost/preprocessor/logical/not.hpp>
|
# include <boost/preprocessor/logical/not.hpp>
|
||||||
@ -82,14 +83,10 @@
|
|||||||
BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
BOOST_FUNCTIONAL_f_type(z, n, ~) \
|
||||||
>::type
|
>::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 \
|
# 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"))
|
"boost/functional/overloaded_function.hpp"))
|
||||||
# include BOOST_PP_ITERATE() // Iterate over function arity.
|
# include BOOST_PP_ITERATE() // Iterate over function arity.
|
||||||
|
|
||||||
@ -113,8 +110,10 @@
|
|||||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||||
# define BOOST_FUNCTIONAL_overloads \
|
# define BOOST_FUNCTIONAL_overloads \
|
||||||
/* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
|
/* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
|
||||||
BOOST_PP_SUB(BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
|
/* (add 2 because iteration started from 2 to MAX) */ \
|
||||||
BOOST_PP_FRAME_ITERATION(1))
|
BOOST_PP_ADD(2, BOOST_PP_SUB( \
|
||||||
|
BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
|
||||||
|
BOOST_PP_FRAME_ITERATION(1)))
|
||||||
# define BOOST_FUNCTIONAL_is_tspec \
|
# define BOOST_FUNCTIONAL_is_tspec \
|
||||||
/* if template specialization */ \
|
/* if template specialization */ \
|
||||||
BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
|
BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
|
# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
|
||||||
|
|
||||||
# include <boost/functional/overloaded_function/config.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/iteration/iterate.hpp>
|
||||||
# include <boost/preprocessor/repetition/enum.hpp>
|
# include <boost/preprocessor/repetition/enum.hpp>
|
||||||
# include <boost/preprocessor/cat.hpp>
|
# include <boost/preprocessor/cat.hpp>
|
||||||
@ -39,12 +39,10 @@ namespace boost { namespace overloaded_function_detail {
|
|||||||
template<typename F>
|
template<typename F>
|
||||||
class base {}; // Empty template cannot be used directly (only its spec).
|
class base {}; // Empty template cannot be used directly (only its spec).
|
||||||
|
|
||||||
/*@todo
|
|
||||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||||
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
|
(3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
|
||||||
"boost/functional/overloaded_function/detail/base.hpp"))
|
"boost/functional/overloaded_function/detail/base.hpp"))
|
||||||
# include BOOST_PP_ITERATE() // Iterate over funciton arity.
|
# include BOOST_PP_ITERATE() // Iterate over funciton arity.
|
||||||
*/
|
|
||||||
|
|
||||||
} } // namespace
|
} } // namespace
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <boost/function_types/result_type.hpp>
|
#include <boost/function_types/result_type.hpp>
|
||||||
#include <boost/type_traits/remove_pointer.hpp>
|
#include <boost/type_traits/remove_pointer.hpp>
|
||||||
#include <boost/type_traits/remove_reference.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/if.hpp>
|
||||||
#include <boost/mpl/identity.hpp>
|
#include <boost/mpl/identity.hpp>
|
||||||
#include <boost/mpl/pop_front.hpp>
|
#include <boost/mpl/pop_front.hpp>
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
|
# Sun does not automatically detect type-of emulation (force it).
|
||||||
|
project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
|
||||||
|
|
||||||
run functor.cpp ;
|
run functor.cpp ;
|
||||||
run make_decl.cpp ;
|
run make_decl.cpp ;
|
||||||
run make_call.cpp ;
|
run make_call.cpp ;
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
#ifndef IDENTITY_HPP_
|
#ifndef IDENTITY_HPP_
|
||||||
#define IDENTITY_HPP_
|
#define IDENTITY_HPP_
|
||||||
|
|
||||||
/** @todo #include <boost/function.hpp> */
|
|
||||||
//[identity_typeof
|
//[identity_typeof
|
||||||
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
|
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
|
||||||
//]
|
//]
|
||||||
|
#include <boost/function.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
//[identity_decls
|
//[identity_decls
|
||||||
|
Reference in New Issue
Block a user