Files

49 lines
1.9 KiB
C++

// Copyright David Abrahams 2005.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef ACTIV_BOOST_PARAMETER_MATCH_DWA2005714_HPP
#define ACTIV_BOOST_PARAMETER_MATCH_DWA2005714_HPP
#include <ActivBoost/parameter/config.hpp>
#if ACTIV_BOOST_WORKAROUND(ACTIV_BOOST_BORLANDC, ACTIV_BOOST_TESTED_AT(0x564))
#include <ActivBoost/parameter/aux_/void.hpp>
#include <ActivBoost/preprocessor/arithmetic/sub.hpp>
#include <ActivBoost/preprocessor/facilities/intercept.hpp>
#include <ActivBoost/preprocessor/repetition/enum_trailing_params.hpp>
#include <ActivBoost/preprocessor/seq/size.hpp>
#define ACTIV_BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \
ACTIV_BOOST_PP_ENUM_TRAILING_PARAMS( \
ACTIV_BOOST_PP_SUB( \
ACTIV_BOOST_PARAMETER_MAX_ARITY \
, ACTIV_BOOST_PP_SEQ_SIZE(ArgTypes) \
) \
, ::Boost::parameter::void_ ACTIV_BOOST_PP_INTERCEPT \
)
/**/
#else
#define ACTIV_BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes)
#endif
#include <ActivBoost/parameter/aux_/preprocessor/seq_enum.hpp>
//
// Generates, e.g.
//
// typename dfs_params::match<A1,A2>::type name = dfs_params()
//
// with workarounds for Borland compatibility.
//
#define ACTIV_BOOST_PARAMETER_MATCH(ParameterSpec, ArgTypes, name) \
typename ParameterSpec::match< \
ACTIV_BOOST_PARAMETER_SEQ_ENUM(ArgTypes) \
ACTIV_BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \
>::type name = ParameterSpec()
/**/
#endif // include guard