diff --git a/.travis.yml b/.travis.yml index 2afb22e..d42c367 100644 --- a/.travis.yml +++ b/.travis.yml @@ -185,6 +185,24 @@ matrix: packages: - libc++-dev + - os: linux + compiler: clang++-5.0 + env: CLANG_X_CUDA=1 + addons: + apt: + packages: + - clang-5.0 + - nvidia-profiler + - nvidia-cuda-dev + - nvidia-cuda-toolkit + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-5.0 + script: + - clang++-5.0 -I . -c -x cuda -nocudainc -nocudalib --cuda-gpu-arch=sm_30 -D__device__="__attribute__((device))" -std=c++11 libs/mp11/test/mp11.cpp + - clang++-5.0 -I . -c -x cuda -nocudainc -nocudalib --cuda-gpu-arch=sm_30 -D__device__="__attribute__((device))" -std=c++14 libs/mp11/test/mp11.cpp + - clang++-5.0 -I . -c -x cuda -nocudainc -nocudalib --cuda-gpu-arch=sm_30 -D__device__="__attribute__((device))" -std=c++1z libs/mp11/test/mp11.cpp + - os: osx compiler: clang++ env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z @@ -206,7 +224,7 @@ install: script: - |- echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam - - ./b2 -j3 libs/mp11/test toolset=$TOOLSET cxxstd=$CXXSTD + - ./b2 -j3 libs/mp11/test toolset=$TOOLSET cxxstd=$CXXSTD ${CXXFLAGS:+cxxflags="$CXXFLAGS"} notifications: email: diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 93fb213..f5a88f6 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -314,8 +314,8 @@ template class L, class... T, std::size_t I> struct mp_at_c_i template struct mp_at_c_impl { - using _map = mp_transform>, L>; - using type = mp_second>>; + using _map = mp_transform >, L>; + using type = mp_second > >; }; #endif @@ -899,7 +899,7 @@ template class L, class T1, class... T, class V, template class L, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class... T, class V, template class F> struct mp_reverse_fold_impl, V, F> { using rest = typename mp_reverse_fold_impl, V, F>::type; - using type = F>>>>>>>>>; + using type = F > > > > > > > > >; }; } // namespace detail @@ -945,7 +945,7 @@ template struct mp_replace_at_impl template using _p = std::is_same>; template using _f = W; - using type = mp_transform_if<_p, _f, L, mp_iota>>; + using type = mp_transform_if<_p, _f, L, mp_iota > >; }; } // namespace detail diff --git a/include/boost/mp11/bind.hpp b/include/boost/mp11/bind.hpp index ac257d4..fa52d2d 100644 --- a/include/boost/mp11/bind.hpp +++ b/include/boost/mp11/bind.hpp @@ -1,7 +1,7 @@ #ifndef BOOST_MP11_BIND_HPP_INCLUDED #define BOOST_MP11_BIND_HPP_INCLUDED -// Copyright 2017 Peter Dimov. +// Copyright 2017, 2018 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -17,6 +17,25 @@ namespace boost namespace mp11 { +// mp_bind_front +template class F, class... T> struct mp_bind_front +{ + // the indirection through mp_defer works around the language inability + // to expand U... into a fixed parameter list of an alias template + + template using fn = typename mp_defer::type; +}; + +template using mp_bind_front_q = mp_bind_front; + +// mp_bind_back +template class F, class... T> struct mp_bind_back +{ + template using fn = typename mp_defer::type; +}; + +template using mp_bind_back_q = mp_bind_back; + // mp_arg template struct mp_arg { @@ -54,6 +73,16 @@ template class F, class... U, class... T> struct eval_bound_a using type = typename mp_bind::template fn; }; +template class F, class... U, class... T> struct eval_bound_arg, T...> +{ + using type = typename mp_bind_front::template fn; +}; + +template class F, class... U, class... T> struct eval_bound_arg, T...> +{ + using type = typename mp_bind_back::template fn; +}; + } // namespace detail template class F, class... T> struct mp_bind @@ -63,25 +92,6 @@ template class F, class... T> struct mp_bind template using mp_bind_q = mp_bind; -// mp_bind_front -template class F, class... T> struct mp_bind_front -{ - // the indirection through mp_defer works around the language inability - // to expand U... into a fixed parameter list of an alias template - - template using fn = typename mp_defer::type; -}; - -template using mp_bind_front_q = mp_bind_front; - -// mp_bind_back -template class F, class... T> struct mp_bind_back -{ - template using fn = typename mp_defer::type; -}; - -template using mp_bind_back_q = mp_bind_back; - } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_append.hpp b/include/boost/mp11/detail/mp_append.hpp index f149066..bbcafad 100644 --- a/include/boost/mp11/detail/mp_append.hpp +++ b/include/boost/mp11/detail/mp_append.hpp @@ -138,7 +138,7 @@ template< template struct mp_append_impl_cuda_workaround { - using type = mp_if_c<(sizeof...(L) > 111), mp_quote, mp_if_c<(sizeof...(L) > 11), mp_quote, mp_quote>>; + using type = mp_if_c<(sizeof...(L) > 111), mp_quote, mp_if_c<(sizeof...(L) > 11), mp_quote, mp_quote > >; }; template struct mp_append_impl: mp_append_impl_cuda_workaround::type::template fn @@ -147,7 +147,7 @@ template struct mp_append_impl: mp_append_impl_cuda_workaround #else -template struct mp_append_impl: mp_if_c<(sizeof...(L) > 111), mp_quote, mp_if_c<(sizeof...(L) > 11), mp_quote, mp_quote>>::template fn +template struct mp_append_impl: mp_if_c<(sizeof...(L) > 111), mp_quote, mp_if_c<(sizeof...(L) > 11), mp_quote, mp_quote > >::template fn { }; diff --git a/include/boost/mp11/function.hpp b/include/boost/mp11/function.hpp index 596f063..2de5ce8 100644 --- a/include/boost/mp11/function.hpp +++ b/include/boost/mp11/function.hpp @@ -79,7 +79,7 @@ template using mp_and = typename detail::mp_and_impl>: #endif // mp_all -#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) || BOOST_WORKAROUND( BOOST_GCC, < 70300 ) +#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) || BOOST_WORKAROUND( BOOST_GCC, < 70400 ) template using mp_all = mp_bool< mp_count_if< mp_list, mp_not >::value == 0 >; @@ -124,7 +124,7 @@ template struct mp_or_impl } // namespace detail // mp_any -#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_WORKAROUND( BOOST_GCC, < 70300 ) +#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_WORKAROUND( BOOST_GCC, < 70400 ) template using mp_any = mp_bool<(static_cast(T::value) || ...)>; diff --git a/include/boost/mp11/integer_sequence.hpp b/include/boost/mp11/integer_sequence.hpp index 08e3120..ad72bd0 100644 --- a/include/boost/mp11/integer_sequence.hpp +++ b/include/boost/mp11/integer_sequence.hpp @@ -73,7 +73,7 @@ public: using type = S4; }; -template struct make_integer_sequence_impl: iseq_if_c>, iseq_if_c>, make_integer_sequence_impl_>> +template struct make_integer_sequence_impl: iseq_if_c>, iseq_if_c>, make_integer_sequence_impl_ > > { }; diff --git a/include/boost/mp11/map.hpp b/include/boost/mp11/map.hpp index 0f7a19c..b9581ac 100644 --- a/include/boost/mp11/map.hpp +++ b/include/boost/mp11/map.hpp @@ -58,7 +58,7 @@ template class F> struct mp_map_update_impl template using _f = std::is_same, mp_first>; // _f3> -> L> - template using _f3 = mp_assign, mp_rename>>; + template using _f3 = mp_assign, mp_rename > >; using type = mp_if< mp_map_contains>, mp_transform_if<_f, _f3, M>, mp_push_back >; }; diff --git a/include/boost/mp11/set.hpp b/include/boost/mp11/set.hpp index cd77d64..fe9c1b2 100644 --- a/include/boost/mp11/set.hpp +++ b/include/boost/mp11/set.hpp @@ -25,7 +25,7 @@ template struct mp_set_contains_impl; template class L, class... T, class V> struct mp_set_contains_impl, V> { - using type = mp_to_bool, mp_inherit...>>>; + using type = mp_to_bool, mp_inherit...> > >; }; } // namespace detail @@ -90,7 +90,7 @@ template struct mp_is_set_impl template class L, class... T> struct mp_is_set_impl> { - using type = mp_to_bool, mp_set_push_back, T...>>>; + using type = mp_to_bool, mp_set_push_back, T...> > >; }; } // namespace detail