Remove use of Boost.Config

This commit is contained in:
Peter Dimov
2018-08-29 20:03:59 +03:00
parent 05a366e8ba
commit 76817e70d6
29 changed files with 184 additions and 125 deletions

View File

@@ -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) );
}