mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 04:52:22 +00:00
tested most template type and value parameters
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#define BOOST_CONTRACT_EXT_PP_TRAITS_ADT_HPP_
|
||||
|
||||
#include <boost/contract/ext_/preprocessor/utility/nil.hpp>
|
||||
#include <boost/contract/ext_/preprocessor/utility/expand.hpp>
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/seq/replace.hpp>
|
||||
|
||||
@@ -44,11 +45,13 @@
|
||||
|
||||
// NOTE: Using `BOOST_PP_TUPLE_ELEM(2, 0, sign_traits)` confuses MSVC here.
|
||||
#define BOOST_CONTRACT_EXT_PP_SIGN_TRAITS_FIRST(sign_traits) \
|
||||
BOOST_CONTRACT_EXT_PP_SIGN_TRAITS_FIRST_ sign_traits
|
||||
BOOST_CONTRACT_EXT_PP_EXPAND1( \
|
||||
BOOST_CONTRACT_EXT_PP_SIGN_TRAITS_FIRST_ sign_traits)
|
||||
|
||||
// NOTE: Using `BOOST_PP_TUPLE_ELEM(2, 1, sign_traits)` confuses MSVC here.
|
||||
#define BOOST_CONTRACT_EXT_PP_SIGN_TRAITS_SECOND(sign_traits) \
|
||||
BOOST_CONTRACT_EXT_PP_SIGN_TRAITS_SECOND_ sign_traits
|
||||
BOOST_CONTRACT_EXT_PP_EXPAND1( \
|
||||
BOOST_CONTRACT_EXT_PP_SIGN_TRAITS_SECOND_ sign_traits)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <boost/contract/ext_/preprocessor/traits/aux_/keyword_paren.hpp>
|
||||
#include <boost/contract/ext_/preprocessor/traits/aux_/type.hpp>
|
||||
#include <boost/contract/ext_/preprocessor/traits/adt.hpp>
|
||||
#include <boost/contract/ext_/preprocessor/utility/expand.hpp>
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
@@ -43,8 +44,11 @@
|
||||
|
||||
#define BOOST_CONTRACT_EXT_PP_TPARAM_TRAITS_KIND_PARSE(sign_traits) \
|
||||
( \
|
||||
BOOST_CONTRACT_EXT_PP_TPARAM_TRAITS_KIND_SIGN_ sign_traits, \
|
||||
BOOST_CONTRACT_EXT_PP_TPARAM_TRAITS_KIND_TRAIT_ sign_traits \
|
||||
BOOST_CONTRACT_EXT_PP_EXPAND1( \
|
||||
BOOST_CONTRACT_EXT_PP_TPARAM_TRAITS_KIND_SIGN_ sign_traits) \
|
||||
, \
|
||||
BOOST_CONTRACT_EXT_PP_EXPAND1( \
|
||||
BOOST_CONTRACT_EXT_PP_TPARAM_TRAITS_KIND_TRAIT_ sign_traits) \
|
||||
)
|
||||
|
||||
// Expand to `typename | class | (,,,) | template( ,,, ) class` (for type,
|
||||
|
||||
18
include/boost/contract/ext_/preprocessor/utility/expand.hpp
Normal file
18
include/boost/contract/ext_/preprocessor/utility/expand.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_EXT_PP_EXPAND_HPP_
|
||||
#define BOOST_CONTRACT_EXT_PP_EXPAND_HPP_
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
// Expand its argument once, `BOOST_PP_EXPAND` expands twice instead:
|
||||
// EXPAND1(x) --> x (x expanded once)
|
||||
// EXPAND(x) --> EXPAND_(x) --> x (x expanded twice)
|
||||
// NOTE: This macro is sometimes useful to enforce proper macro expansion on
|
||||
// MSVC (on better preprocessors like GCC, CLang, and Wave this macro is not
|
||||
// necessary instead). For example, `EXPAND1(macro args) ...` where `args` is
|
||||
// `(a, b EMPTY)` expands to `macro(a, b EMPTY) ...`, otherwise MSVc would
|
||||
// sometimes confuse `...` as arguments for `EMPTY`.
|
||||
#define BOOST_CONTRACT_EXT_PP_EXPAND1(tokens) tokens
|
||||
|
||||
#endif // #include gaurd
|
||||
|
||||
Reference in New Issue
Block a user