mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 22:34:31 +02:00
Handle ETI in BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC, since we need to invoke that anyway.
Make is_even work with vc6/7. [SVN r20122]
This commit is contained in:
@@ -71,11 +71,6 @@ AUX_AGLORITM_TRAIT_SPEC(end, nested_begin_end_tag, typename Sequence::end)
|
||||
AUX_AGLORITM_TRAIT_SPEC(begin, non_sequence_tag, void_)
|
||||
AUX_AGLORITM_TRAIT_SPEC(end, non_sequence_tag, void_)
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
AUX_AGLORITM_TRAIT_SPEC(begin, int, int)
|
||||
AUX_AGLORITM_TRAIT_SPEC(end, int, int)
|
||||
#endif
|
||||
|
||||
# undef AUX_AGLORITM_TRAIT_SPEC
|
||||
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) /**/
|
||||
|
||||
#else
|
||||
#elif !defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
|
||||
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
|
||||
template<> struct trait<void_> \
|
||||
@@ -36,6 +36,24 @@ template<> struct trait<void_> \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
|
||||
template<> struct trait<void_> \
|
||||
{ \
|
||||
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct algorithm \
|
||||
{ \
|
||||
}; \
|
||||
}; \
|
||||
template<> struct trait<int> \
|
||||
{ \
|
||||
template< BOOST_MPL_PP_PARAMS(i, typename T) > struct algorithm \
|
||||
{ \
|
||||
typedef int type; \
|
||||
}; \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
#endif // BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
|
||||
|
||||
#endif // BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
|
||||
|
@@ -21,16 +21,32 @@
|
||||
#include "boost/mpl/aux_/void_spec.hpp"
|
||||
#include "boost/mpl/aux_/lambda_support.hpp"
|
||||
#include "boost/mpl/aux_/config/eti.hpp"
|
||||
#include "boost/detail/workaround.hpp"
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
namespace math {
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
namespace aux
|
||||
{
|
||||
template <class N>
|
||||
struct is_even_base
|
||||
{
|
||||
enum { value = (N::value % 2) == 0 };
|
||||
typedef bool_<value> type;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
template<
|
||||
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(N)
|
||||
>
|
||||
struct is_even
|
||||
: bool_<((N::value % 2) == 0)>
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
: aux::is_even_base<N>::type
|
||||
#else
|
||||
: bool_<((N::value % 2) == 0)>
|
||||
#endif
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_even,(N))
|
||||
};
|
||||
|
Reference in New Issue
Block a user