forked from boostorg/mp11
Remove use of Boost.Config
This commit is contained in:
@ -21,8 +21,7 @@
|
||||
#include <boost/mp11/detail/mp_min_element.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/mp11/integer_sequence.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
@ -41,7 +40,7 @@ template<template<class...> class F, class... L> struct mp_transform_impl
|
||||
|
||||
template<template<class...> class F, template<class...> class L, class... T> struct mp_transform_impl<F, L<T...>>
|
||||
{
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
|
||||
template<class... U> struct f { using type = F<U...>; };
|
||||
|
||||
@ -56,7 +55,7 @@ template<template<class...> class F, template<class...> class L, class... T> str
|
||||
|
||||
template<template<class...> class F, template<class...> class L1, class... T1, template<class...> class L2, class... T2> struct mp_transform_impl<F, L1<T1...>, L2<T2...>>
|
||||
{
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
|
||||
template<class... U> struct f { using type = F<U...>; };
|
||||
|
||||
@ -71,7 +70,7 @@ template<template<class...> class F, template<class...> class L1, class... T1, t
|
||||
|
||||
template<template<class...> class F, template<class...> class L1, class... T1, template<class...> class L2, class... T2, template<class...> class L3, class... T3> struct mp_transform_impl<F, L1<T1...>, L2<T2...>, L3<T3...>>
|
||||
{
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
|
||||
template<class... U> struct f { using type = F<U...>; };
|
||||
|
||||
@ -84,7 +83,7 @@ template<template<class...> class F, template<class...> class L1, class... T1, t
|
||||
#endif
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, == 1900 ) || BOOST_WORKAROUND( BOOST_GCC, < 40800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, == 1900 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40800 )
|
||||
|
||||
template<class... L> using mp_same_size_1 = mp_same<mp_size<L>...>;
|
||||
template<class... L> struct mp_same_size_2: mp_defer<mp_same_size_1, L...> {};
|
||||
@ -95,7 +94,7 @@ struct list_size_mismatch
|
||||
{
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<template<class...> class F, class... L> struct mp_transform_cuda_workaround
|
||||
{
|
||||
@ -106,13 +105,13 @@ template<template<class...> class F, class... L> struct mp_transform_cuda_workar
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, == 1900 ) || BOOST_WORKAROUND( BOOST_GCC, < 40800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, == 1900 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40800 )
|
||||
|
||||
template<template<class...> class F, class... L> using mp_transform = typename mp_if<typename detail::mp_same_size_2<L...>::type, detail::mp_transform_impl<F, L...>, detail::list_size_mismatch>::type;
|
||||
|
||||
#else
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<template<class...> class F, class... L> using mp_transform = typename detail::mp_transform_cuda_workaround< F, L...>::type::type;
|
||||
|
||||
@ -155,7 +154,7 @@ template<template<class...> class P, template<class...> class F, class... L> str
|
||||
using Qp = mp_quote<P>;
|
||||
using Qf = mp_quote<F>;
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
|
||||
template<class... U> struct _f_ { using type = mp_eval_if_q<mp_not<mp_invoke<Qp, U...>>, mp_first<mp_list<U...>>, Qf, U...>; };
|
||||
template<class... U> using _f = typename _f_<U...>::type;
|
||||
@ -182,7 +181,7 @@ template<class L, class V> struct mp_fill_impl;
|
||||
|
||||
template<template<class...> class L, class... T, class V> struct mp_fill_impl<L<T...>, V>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1900 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1900 )
|
||||
|
||||
template<class...> struct _f { using type = V; };
|
||||
using type = L<typename _f<T>::type...>;
|
||||
@ -320,7 +319,7 @@ template<class L, std::size_t I> struct mp_at_c_impl
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<class L, std::size_t I> struct mp_at_c_cuda_workaround
|
||||
{
|
||||
@ -331,7 +330,7 @@ template<class L, std::size_t I> struct mp_at_c_cuda_workaround
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<class L, std::size_t I> using mp_at_c = typename detail::mp_at_c_cuda_workaround< L, I >::type::type;
|
||||
|
||||
@ -392,7 +391,7 @@ template<class L, class V, class W> struct mp_replace_impl;
|
||||
|
||||
template<template<class...> class L, class... T, class V, class W> struct mp_replace_impl<L<T...>, V, W>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
template<class A> struct _f { using type = mp_if<std::is_same<A, V>, W, A>; };
|
||||
using type = L<typename _f<T>::type...>;
|
||||
#else
|
||||
@ -413,7 +412,7 @@ template<class L, template<class...> class P, class W> struct mp_replace_if_impl
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P, class W> struct mp_replace_if_impl<L<T...>, P, W>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
template<class U> struct _f { using type = mp_if<P<U>, W, U>; };
|
||||
using type = L<typename _f<T>::type...>;
|
||||
#else
|
||||
@ -435,7 +434,7 @@ template<class L, template<class...> class P> struct mp_copy_if_impl;
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P> struct mp_copy_if_impl<L<T...>, P>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
template<class U> struct _f { using type = mp_if<P<U>, mp_list<U>, mp_list<>>; };
|
||||
using type = mp_append<L<>, typename _f<T>::type...>;
|
||||
#else
|
||||
@ -457,7 +456,7 @@ template<class L, class V> struct mp_remove_impl;
|
||||
|
||||
template<template<class...> class L, class... T, class V> struct mp_remove_impl<L<T...>, V>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
template<class U> struct _f { using type = mp_if<std::is_same<U, V>, mp_list<>, mp_list<U>>; };
|
||||
using type = mp_append<L<>, typename _f<T>::type...>;
|
||||
#else
|
||||
@ -478,7 +477,7 @@ template<class L, template<class...> class P> struct mp_remove_if_impl;
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P> struct mp_remove_if_impl<L<T...>, P>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
template<class U> struct _f { using type = mp_if<P<U>, mp_list<>, mp_list<U>>; };
|
||||
using type = mp_append<L<>, typename _f<T>::type...>;
|
||||
#else
|
||||
@ -514,7 +513,7 @@ namespace detail
|
||||
|
||||
template<class L, template<class...> class P> struct mp_sort_impl;
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P> struct mp_sort_impl<L<T...>, P>
|
||||
{
|
||||
@ -578,7 +577,7 @@ template<template<class...> class L, class T1, class... T, std::size_t I, templa
|
||||
|
||||
using L2 = mp_second<part>;
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
struct detail
|
||||
{
|
||||
@ -593,9 +592,10 @@ template<template<class...> class L, class T1, class... T, std::size_t I, templa
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
||||
using type = typename detail::mp_nth_element_impl_cuda_workaround::type::type;
|
||||
|
||||
#else
|
||||
#else
|
||||
|
||||
using type = typename mp_cond<
|
||||
|
||||
@ -605,7 +605,7 @@ template<template<class...> class L, class T1, class... T, std::size_t I, templa
|
||||
|
||||
>::type;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@ -620,7 +620,7 @@ namespace detail
|
||||
|
||||
template<class L, class V> struct mp_find_impl;
|
||||
|
||||
#if defined( BOOST_CLANG ) && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS )
|
||||
#if BOOST_MP11_CLANG && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS )
|
||||
|
||||
struct mp_index_holder
|
||||
{
|
||||
@ -657,7 +657,7 @@ template<template<class...> class L, class V> struct mp_find_impl<L<>, V>
|
||||
using type = mp_size_t<0>;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_CXX14_CONSTEXPR )
|
||||
#if defined( BOOST_MP11_HAS_CXX14_CONSTEXPR )
|
||||
|
||||
constexpr std::size_t cx_find_index( bool const * first, bool const * last )
|
||||
{
|
||||
@ -689,7 +689,7 @@ template<template<class...> class L, class... T, class V> struct mp_find_impl<L<
|
||||
|
||||
#else
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<template<class...> class L, class... T, class V> struct mp_find_impl<L<T...>, V>
|
||||
{
|
||||
@ -729,7 +729,7 @@ namespace detail
|
||||
|
||||
template<class L, template<class...> class P> struct mp_find_if_impl;
|
||||
|
||||
#if defined( BOOST_CLANG ) && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS )
|
||||
#if BOOST_MP11_CLANG && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS )
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P> struct mp_find_if_impl<L<T...>, P>
|
||||
{
|
||||
@ -752,7 +752,7 @@ template<template<class...> class L, class... T, template<class...> class P> str
|
||||
|
||||
#else
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P> struct mp_find_if_impl<L<T...>, P>
|
||||
{
|
||||
@ -793,7 +793,7 @@ namespace detail
|
||||
|
||||
template<class L> struct mp_reverse_impl;
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<template<class...> class L, class... T> struct mp_reverse_impl<L<T...>>
|
||||
{
|
||||
@ -873,7 +873,7 @@ namespace detail
|
||||
|
||||
template<class L, class V, template<class...> class F> struct mp_reverse_fold_impl;
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<template<class...> class L, class... T, class V, template<class...> class F> struct mp_reverse_fold_impl<L<T...>, V, F>
|
||||
{
|
||||
@ -957,20 +957,20 @@ template<class L, std::size_t I, class W> using mp_replace_at_c = typename detai
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class... T, class F> BOOST_CONSTEXPR F mp_for_each_impl( mp_list<T...>, F && f )
|
||||
template<class... T, class F> BOOST_MP11_CONSTEXPR F mp_for_each_impl( mp_list<T...>, F && f )
|
||||
{
|
||||
using A = int[sizeof...(T)];
|
||||
return (void)A{ ((void)f(T()), 0)... }, std::forward<F>(f);
|
||||
}
|
||||
|
||||
template<class F> BOOST_CONSTEXPR F mp_for_each_impl( mp_list<>, F && f )
|
||||
template<class F> BOOST_MP11_CONSTEXPR F mp_for_each_impl( mp_list<>, F && f )
|
||||
{
|
||||
return std::forward<F>(f);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class L, class F> BOOST_CONSTEXPR F mp_for_each( F && f )
|
||||
template<class L, class F> BOOST_MP11_CONSTEXPR F mp_for_each( F && f )
|
||||
{
|
||||
return detail::mp_for_each_impl( mp_rename<L, mp_list>(), std::forward<F>(f) );
|
||||
}
|
||||
|
@ -1,43 +1,114 @@
|
||||
#ifndef BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED
|
||||
#define BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED
|
||||
|
||||
// Copyright 2016 Peter Dimov.
|
||||
// Copyright 2016, 2018 Peter Dimov.
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
// BOOST_MP11_WORKAROUND
|
||||
|
||||
#if defined( BOOST_NO_CXX11_CONSTEXPR )
|
||||
#if defined( BOOST_STRICT_CONFIG ) || defined( BOOST_MP11_NO_WORKAROUNDS )
|
||||
|
||||
# define BOOST_MP11_NO_CONSTEXPR
|
||||
# define BOOST_MP11_WORKAROUND( symbol, test ) 0
|
||||
|
||||
#elif defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#else
|
||||
|
||||
# define BOOST_MP11_NO_CONSTEXPR
|
||||
# define BOOST_MP11_WORKAROUND( symbol, test ) ((symbol) != 0 && ((symbol) test))
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__cpp_fold_expressions) && __cpp_fold_expressions >= 201603
|
||||
//
|
||||
|
||||
# define BOOST_MP11_HAS_FOLD_EXPRESSIONS
|
||||
#define BOOST_MP11_CUDA 0
|
||||
#define BOOST_MP11_CLANG 0
|
||||
#define BOOST_MP11_INTEL 0
|
||||
#define BOOST_MP11_GCC 0
|
||||
#define BOOST_MP11_MSVC 0
|
||||
|
||||
#elif defined(BOOST_CLANG) && defined(__has_cpp_attribute)
|
||||
# if __has_cpp_attribute(fallthrough) && __cplusplus >= 201406L // Clang 3.9+ in c++1z mode
|
||||
#define BOOST_MP11_CONSTEXPR constexpr
|
||||
|
||||
# define BOOST_MP11_HAS_FOLD_EXPRESSIONS
|
||||
#if defined( __CUDACC__ )
|
||||
|
||||
// nvcc
|
||||
|
||||
# undef BOOST_MP11_CUDA
|
||||
# define BOOST_MP11_CUDA (__CUDACC_VER_MAJOR__ * 1000000 + __CUDACC_VER_MINOR__ * 10000 + __CUDACC_VER_BUILD__)
|
||||
|
||||
// CUDA (8.0) has no constexpr support in msvc mode:
|
||||
# if defined(_MSC_VER) && (BOOST_MP11_CUDA < 9000000)
|
||||
|
||||
# define BOOST_MP11_NO_CONSTEXPR
|
||||
|
||||
# undef BOOST_MP11_CONSTEXPR
|
||||
# define BOOST_MP11_CONSTEXPR
|
||||
|
||||
# endif
|
||||
|
||||
#elif defined(__clang__)
|
||||
|
||||
// clang++
|
||||
|
||||
# undef BOOST_MP11_CLANG
|
||||
# define BOOST_MP11_CLANG (__clang_major__ * 100 + __clang_minor__)
|
||||
|
||||
# if defined(__has_cpp_attribute)
|
||||
# if __has_cpp_attribute(fallthrough) && __cplusplus >= 201406L // Clang 3.9+ in c++1z mode
|
||||
# define BOOST_MP11_HAS_FOLD_EXPRESSIONS
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEL_COMPILER)
|
||||
|
||||
// Intel C++
|
||||
|
||||
# undef BOOST_MP11_INTEL
|
||||
# define BOOST_MP11_INTEL __INTEL_COMPILER
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
// g++
|
||||
|
||||
# undef BOOST_MP11_GCC
|
||||
# define BOOST_MP11_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
// MS Visual C++
|
||||
|
||||
# undef BOOST_MP11_MSVC
|
||||
# define BOOST_MP11_MSVC _MSC_VER
|
||||
|
||||
# if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
# define BOOST_MP11_NO_CONSTEXPR
|
||||
# endif
|
||||
|
||||
#if _MSC_FULL_VER < 190024210 // 2015u3
|
||||
# undef BOOST_MP11_CONSTEXPR
|
||||
# define BOOST_MP11_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// BOOST_MP11_HAS_CXX14_CONSTEXPR
|
||||
|
||||
#if !defined(BOOST_MP11_NO_CONSTEXPR) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304
|
||||
# define BOOST_MP11_HAS_CXX14_CONSTEXPR
|
||||
#endif
|
||||
|
||||
// BOOST_MP11_HAS_FOLD_EXPRESSIONS
|
||||
|
||||
#if !defined(BOOST_MP11_HAS_FOLD_EXPRESSIONS) && defined(__cpp_fold_expressions) && __cpp_fold_expressions >= 201603
|
||||
# define BOOST_MP11_HAS_FOLD_EXPRESSIONS
|
||||
#endif
|
||||
|
||||
// BOOST_MP11_HAS_TYPE_PACK_ELEMENT
|
||||
|
||||
#if defined(__has_builtin)
|
||||
# if __has_builtin(__type_pack_element)
|
||||
|
||||
# define BOOST_MP11_HAS_TYPE_PACK_ELEMENT
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -10,8 +10,7 @@
|
||||
|
||||
#include <boost/mp11/detail/mp_list.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -25,7 +24,7 @@ namespace detail
|
||||
|
||||
template<class... L> struct mp_append_impl;
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<> struct mp_append_impl<>
|
||||
{
|
||||
@ -133,7 +132,7 @@ template<
|
||||
using type = typename mp_append_impl<prefix, Lr...>::type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<class... L>
|
||||
struct mp_append_impl_cuda_workaround
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/detail/mp_plus.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -91,7 +90,7 @@ template<template<class...> class L, class... T, template<class...> class P> str
|
||||
|
||||
template<template<class...> class L, class... T, template<class...> class P> struct mp_count_if_impl<L<T...>, P>
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
|
||||
|
||||
template<class T> struct _f { using type = mp_to_bool<P<T>>; };
|
||||
using type = mp_size_t<mp_plus<typename _f<T>::type...>::value>;
|
||||
|
@ -8,8 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -25,7 +24,7 @@ template<class L, class V, template<class...> class F> struct mp_fold_impl
|
||||
// An error "no type named 'type'" here means that the first argument to mp_fold is not a list
|
||||
};
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
template<template<class...> class L, class... T, class V, template<class...> class F> struct mp_fold_impl<L<T...>, V, F>
|
||||
{
|
||||
|
@ -9,7 +9,6 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
@ -38,7 +37,7 @@ template<> struct mp_plus_impl<>
|
||||
using type = std::integral_constant<int, 0>;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_GCC, < 40800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40800 )
|
||||
|
||||
template<class T1, class... T> struct mp_plus_impl<T1, T...>
|
||||
{
|
||||
|
@ -9,12 +9,12 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
|
||||
#if !defined( BOOST_NO_CXX14_CONSTEXPR )
|
||||
#if defined( BOOST_MP11_HAS_CXX14_CONSTEXPR )
|
||||
# define BOOST_MP11_CONSTEXPR14 constexpr
|
||||
#else
|
||||
# define BOOST_MP11_CONSTEXPR14
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <boost/mp11/detail/mp_plus.hpp>
|
||||
#include <boost/mp11/detail/mp_min_element.hpp>
|
||||
#include <boost/mp11/detail/mp_void.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
@ -26,7 +27,7 @@ namespace mp11
|
||||
// in detail/mp_void.hpp
|
||||
|
||||
// mp_and<T...>
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1910 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1910 )
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -79,7 +80,7 @@ template<class... T> using mp_and = typename detail::mp_and_impl<mp_list<T...>>:
|
||||
#endif
|
||||
|
||||
// mp_all<T...>
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) || BOOST_WORKAROUND( BOOST_GCC, < 80200 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 80200 )
|
||||
|
||||
template<class... T> using mp_all = mp_bool< mp_count_if< mp_list<T...>, mp_not >::value == 0 >;
|
||||
|
||||
@ -124,7 +125,7 @@ template<class T1, class... T> struct mp_or_impl<T1, T...>
|
||||
} // namespace detail
|
||||
|
||||
// mp_any<T...>
|
||||
#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_WORKAROUND( BOOST_GCC, < 80200 )
|
||||
#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 80200 )
|
||||
|
||||
template<class... T> using mp_any = mp_bool<(static_cast<bool>(T::value) || ...)>;
|
||||
|
||||
|
@ -11,8 +11,7 @@
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/detail/mp_list.hpp>
|
||||
#include <boost/mp11/detail/mp_append.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
|
@ -9,14 +9,13 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mp11/integer_sequence.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#if BOOST_MP11_MSVC
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable: 4100 ) // unreferenced formal parameter 'tp'
|
||||
#endif
|
||||
@ -30,7 +29,7 @@ namespace mp11
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class F, class Tp, std::size_t... J> BOOST_CONSTEXPR auto tuple_apply_impl( F && f, Tp && tp, integer_sequence<std::size_t, J...> )
|
||||
template<class F, class Tp, std::size_t... J> BOOST_MP11_CONSTEXPR auto tuple_apply_impl( F && f, Tp && tp, integer_sequence<std::size_t, J...> )
|
||||
-> decltype( std::forward<F>(f)( std::get<J>(std::forward<Tp>(tp))... ) )
|
||||
{
|
||||
return std::forward<F>(f)( std::get<J>(std::forward<Tp>(tp))... );
|
||||
@ -40,7 +39,7 @@ template<class F, class Tp, std::size_t... J> BOOST_CONSTEXPR auto tuple_apply_i
|
||||
|
||||
template<class F, class Tp,
|
||||
class Seq = make_index_sequence<std::tuple_size<typename std::remove_reference<Tp>::type>::value>>
|
||||
BOOST_CONSTEXPR auto tuple_apply( F && f, Tp && tp )
|
||||
BOOST_MP11_CONSTEXPR auto tuple_apply( F && f, Tp && tp )
|
||||
-> decltype( detail::tuple_apply_impl( std::forward<F>(f), std::forward<Tp>(tp), Seq() ) )
|
||||
{
|
||||
return detail::tuple_apply_impl( std::forward<F>(f), std::forward<Tp>(tp), Seq() );
|
||||
@ -50,7 +49,7 @@ BOOST_CONSTEXPR auto tuple_apply( F && f, Tp && tp )
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class T, class Tp, std::size_t... J> BOOST_CONSTEXPR T construct_from_tuple_impl( Tp && tp, integer_sequence<std::size_t, J...> )
|
||||
template<class T, class Tp, std::size_t... J> BOOST_MP11_CONSTEXPR T construct_from_tuple_impl( Tp && tp, integer_sequence<std::size_t, J...> )
|
||||
{
|
||||
return T( std::get<J>(std::forward<Tp>(tp))... );
|
||||
}
|
||||
@ -59,7 +58,7 @@ template<class T, class Tp, std::size_t... J> BOOST_CONSTEXPR T construct_from_t
|
||||
|
||||
template<class T, class Tp,
|
||||
class Seq = make_index_sequence<std::tuple_size<typename std::remove_reference<Tp>::type>::value>>
|
||||
BOOST_CONSTEXPR T construct_from_tuple( Tp && tp )
|
||||
BOOST_MP11_CONSTEXPR T construct_from_tuple( Tp && tp )
|
||||
{
|
||||
return detail::construct_from_tuple_impl<T>( std::forward<Tp>(tp), Seq() );
|
||||
}
|
||||
@ -68,20 +67,20 @@ BOOST_CONSTEXPR T construct_from_tuple( Tp && tp )
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class Tp, std::size_t... J, class F> BOOST_CONSTEXPR F tuple_for_each_impl( Tp && tp, integer_sequence<std::size_t, J...>, F && f )
|
||||
template<class Tp, std::size_t... J, class F> BOOST_MP11_CONSTEXPR F tuple_for_each_impl( Tp && tp, integer_sequence<std::size_t, J...>, F && f )
|
||||
{
|
||||
using A = int[sizeof...(J)];
|
||||
return (void)A{ ((void)f(std::get<J>(std::forward<Tp>(tp))), 0)... }, std::forward<F>(f);
|
||||
}
|
||||
|
||||
template<class Tp, class F> BOOST_CONSTEXPR F tuple_for_each_impl( Tp && /*tp*/, integer_sequence<std::size_t>, F && f )
|
||||
template<class Tp, class F> BOOST_MP11_CONSTEXPR F tuple_for_each_impl( Tp && /*tp*/, integer_sequence<std::size_t>, F && f )
|
||||
{
|
||||
return std::forward<F>(f);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class Tp, class F> BOOST_CONSTEXPR F tuple_for_each( Tp && tp, F && f )
|
||||
template<class Tp, class F> BOOST_MP11_CONSTEXPR F tuple_for_each( Tp && tp, F && f )
|
||||
{
|
||||
using seq = make_index_sequence<std::tuple_size<typename std::remove_reference<Tp>::type>::value>;
|
||||
return detail::tuple_for_each_impl( std::forward<Tp>(tp), seq(), std::forward<F>(f) );
|
||||
@ -90,7 +89,7 @@ template<class Tp, class F> BOOST_CONSTEXPR F tuple_for_each( Tp && tp, F && f )
|
||||
} // namespace mp11
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#if BOOST_MP11_MSVC
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
|
@ -9,8 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -54,7 +53,7 @@ template<class C, class T, class... E> using mp_if = typename detail::mp_if_c_im
|
||||
|
||||
// mp_valid
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_INTEL, BOOST_TESTED_AT(1800))
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_INTEL, != 0 ) // tested at 1800
|
||||
|
||||
// contributed by Roland Schulz in https://github.com/boostorg/mp11/issues/17
|
||||
|
||||
@ -106,7 +105,7 @@ struct mp_no_type
|
||||
{
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<template<class...> class F, class... T> struct mp_defer_cuda_workaround
|
||||
{
|
||||
@ -117,7 +116,7 @@ template<template<class...> class F, class... T> struct mp_defer_cuda_workaround
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_CUDA_VERSION, >= 9000000 && BOOST_CUDA_VERSION < 10000000 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 )
|
||||
|
||||
template<template<class...> class F, class... T> using mp_defer = typename detail::mp_defer_cuda_workaround< F, T...>::type;
|
||||
|
||||
@ -189,7 +188,7 @@ template<template<class...> class F> struct mp_quote_trait
|
||||
};
|
||||
|
||||
// mp_invoke
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1900 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1900 )
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -200,7 +199,7 @@ template<class Q, class... T> struct mp_invoke_impl: mp_defer<Q::template fn, T.
|
||||
|
||||
template<class Q, class... T> using mp_invoke = typename detail::mp_invoke_impl<Q, T...>::type;
|
||||
|
||||
#elif BOOST_WORKAROUND( BOOST_GCC, < 50000 )
|
||||
#elif BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 50000 )
|
||||
|
||||
template<class Q, class... T> using mp_invoke = typename mp_defer<Q::template fn, T...>::type;
|
||||
|
||||
|
@ -12,9 +12,8 @@
|
||||
#endif
|
||||
|
||||
#include <boost/mp11/tuple.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <tuple>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
@ -33,7 +32,7 @@ struct T2
|
||||
|
||||
T2( std::unique_ptr<int> x, std::unique_ptr<int> y, std::unique_ptr<int> z ): x(std::move(x)), y(std::move(y)), z(std::move(z)) {}
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
|
||||
T2( T2&& r ): x( std::move(r.x) ), y( std::move(r.y) ), z( std::move(r.z) ) {}
|
||||
|
||||
|
@ -12,11 +12,11 @@
|
||||
#endif
|
||||
|
||||
#include <boost/mp11/tuple.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
// Technically std::tuple isn't constexpr enabled in C++11, but it works with libstdc++
|
||||
|
||||
#if defined( BOOST_NO_CXX11_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
#if defined( BOOST_MP11_NO_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
|
||||
int main() {}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <boost/mp11/function.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
@ -59,7 +60,7 @@ int main()
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<check1<void, int, float>, mp_true>));
|
||||
|
||||
#if !BOOST_WORKAROUND( BOOST_GCC, < 40900 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40900 )
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<check2<void, int, float>, mp_true>));
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <boost/mp11/function.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
@ -20,7 +21,7 @@ template<class... T> using check2 = mp_any<mp_any<std::is_nothrow_copy_construct
|
||||
template<class... T> using check3 = mp_any<mp_all<std::is_nothrow_copy_constructible<T>...>, std::is_nothrow_default_constructible<T>...>;
|
||||
|
||||
template<bool is_trivially_destructible, bool is_single_buffered, class... T> struct variant_base_impl {};
|
||||
#if BOOST_WORKAROUND( BOOST_GCC, < 40800 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40800 )
|
||||
template<class... T> using variant_base = variant_base_impl<mp_all<std::has_trivial_destructor<T>...>::value, mp_any<mp_all<std::is_nothrow_move_constructible<T>...>, std::is_nothrow_default_constructible<T>...>::value, T...>;
|
||||
#else
|
||||
template<class... T> using variant_base = variant_base_impl<mp_all<std::is_trivially_destructible<T>...>::value, mp_any<mp_all<std::is_nothrow_move_constructible<T>...>, std::is_nothrow_default_constructible<T>...>::value, T...>;
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
@ -47,12 +48,12 @@ int main()
|
||||
BOOST_TEST_TRAIT_FALSE((has_type<add_pointer_impl<>>));
|
||||
BOOST_TEST_TRAIT_FALSE((has_type<add_pointer_impl<void, void>>));
|
||||
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
BOOST_TEST_TRAIT_TRUE((has_type<Q_add_pointer_impl<void>>));
|
||||
#endif
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<Q_add_pointer_impl<void>::type, void*>));
|
||||
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
BOOST_TEST_TRAIT_TRUE((has_type<Q_add_pointer_impl<int>>));
|
||||
#endif
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<Q_add_pointer_impl<int>::type, int*>));
|
||||
|
@ -11,8 +11,6 @@
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
|
@ -9,12 +9,11 @@
|
||||
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <tuple>
|
||||
|
||||
#if !defined( BOOST_NO_CXX14_CONSTEXPR )
|
||||
#if defined( BOOST_MP11_HAS_CXX14_CONSTEXPR )
|
||||
# define CONSTEXPR14 constexpr
|
||||
#else
|
||||
# define CONSTEXPR14
|
||||
@ -46,7 +45,7 @@ int main()
|
||||
|
||||
BOOST_TEST_EQ( (mp_for_each<std::pair<int, short>>( F{0} ).s), 12 );
|
||||
|
||||
#if defined( BOOST_NO_CXX11_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
#if defined( BOOST_MP11_NO_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
#else
|
||||
|
||||
static_assert( mp_for_each<mp_list<>>( 11 ) == 11, "mp_for_each<mp_list<>>( 11 ) == 11" );
|
||||
@ -54,7 +53,7 @@ int main()
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_CXX14_CONSTEXPR ) && !BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||
#if defined( BOOST_MP11_HAS_CXX14_CONSTEXPR )
|
||||
|
||||
constexpr auto r1 = mp_for_each<mp_list<int, short, char>>( F{0} );
|
||||
static_assert( r1.s == 123, "r1.s == 123" );
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
@ -33,8 +34,7 @@ int main()
|
||||
|
||||
using Qt = mp_quote_trait<mp_identity>;
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#else
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke, Qt>));
|
||||
#endif
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<mp_invoke, Qt, void>));
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
@ -38,14 +39,12 @@ int main()
|
||||
{
|
||||
using Q = mp_quote<mp_identity_t>;
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#else
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
using R1 = Y<Q::fn, void, char, int>;
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<R1, X<void, char, int>>));
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1920 && BOOST_MSVC >= 1900 )
|
||||
#else
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 && BOOST_MP11_MSVC >= 1900 )
|
||||
using R2 = Z<Q, void, char, int>;
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<R2, X<void, char, int>>));
|
||||
#endif
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
@ -43,7 +44,7 @@ int main()
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<Q::fn<void>, void const>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<Q::fn<int[]>, int const[]>));
|
||||
|
||||
#if !BOOST_WORKAROUND( BOOST_GCC, < 40900 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40900 )
|
||||
|
||||
// g++ 4.7, 4.8 have difficulties with preserving top-level const
|
||||
|
||||
|
@ -11,8 +11,6 @@
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
|
@ -11,8 +11,6 @@
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
using boost::mp11::mp_transform;
|
||||
@ -29,7 +30,7 @@ int main()
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void, void, void, void>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void, void, void, void, void>));
|
||||
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<transform, mp_list<>>));
|
||||
#endif
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
template<class T> struct Xi
|
||||
@ -52,7 +53,7 @@ int main()
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_pointer>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<add_pointer, void>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<add_pointer, int>));
|
||||
#if !defined( BOOST_MSVC ) || !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
// msvc-12.0 can form pointer to reference
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_pointer, int&>));
|
||||
#endif
|
||||
@ -63,10 +64,10 @@ int main()
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<Q_add_pointer::fn, int>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<Q_add_pointer::fn, void, void>));
|
||||
|
||||
#if !defined( BOOST_GCC ) || !BOOST_WORKAROUND( BOOST_GCC, < 70000 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 70000 )
|
||||
// g++ up to at least 6.3 doesn't like add_reference for some reason or other
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_reference>));
|
||||
#if !defined( BOOST_MSVC ) || !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
// msvc-12.0 gives an internal error here
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_reference, void>));
|
||||
#endif
|
||||
@ -76,7 +77,7 @@ int main()
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_extents>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<add_extents, int>));
|
||||
#if !defined( BOOST_MSVC ) || !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||
// msvc-12.0 can form arrays to void or int&
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_extents, void>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_extents, int&>));
|
||||
|
@ -8,9 +8,8 @@
|
||||
|
||||
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <tuple>
|
||||
|
||||
using boost::mp11::mp_size_t;
|
||||
@ -49,7 +48,7 @@ struct G
|
||||
|
||||
int main()
|
||||
{
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1900 )
|
||||
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1900 )
|
||||
|
||||
G()( mp_size_t<1>{} );
|
||||
G()( mp_size_t<2>{} );
|
||||
|
@ -6,9 +6,9 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_CXX14_CONSTEXPR )
|
||||
#if !defined( BOOST_MP11_HAS_CXX14_CONSTEXPR )
|
||||
|
||||
int main() {}
|
||||
|
||||
@ -16,8 +16,6 @@ int main() {}
|
||||
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
using boost::mp11::mp_size_t;
|
||||
using boost::mp11::mp_with_index;
|
||||
|
@ -12,11 +12,11 @@
|
||||
#endif
|
||||
|
||||
#include <boost/mp11/tuple.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
// Technically std::tuple isn't constexpr enabled in C++11, but it works with libstdc++
|
||||
|
||||
#if defined( BOOST_NO_CXX11_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
#if defined( BOOST_MP11_NO_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
|
||||
int main() {}
|
||||
|
||||
|
@ -12,11 +12,11 @@
|
||||
#endif
|
||||
|
||||
#include <boost/mp11/tuple.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
|
||||
// Technically std::tuple isn't constexpr enabled in C++11, but it works with libstdc++
|
||||
|
||||
#if defined( BOOST_NO_CXX11_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
#if defined( BOOST_MP11_NO_CONSTEXPR ) || ( !defined( __GLIBCXX__ ) && __cplusplus < 201400L )
|
||||
|
||||
int main() {}
|
||||
|
||||
|
Reference in New Issue
Block a user