1
0
forked from boostorg/mp11

Merge branch 'develop' of github.com:boostorg/mp11 into workaround-nvcc-cuda

This commit is contained in:
Alexander Matthes
2018-04-26 20:29:02 +02:00
8 changed files with 61 additions and 33 deletions

View File

@@ -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:

View File

@@ -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<template<class...> 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<class... U> using fn = typename mp_defer<F, T..., U...>::type;
};
template<class Q, class... T> using mp_bind_front_q = mp_bind_front<Q::template fn, T...>;
// mp_bind_back
template<template<class...> class F, class... T> struct mp_bind_back
{
template<class... U> using fn = typename mp_defer<F, U..., T...>::type;
};
template<class Q, class... T> using mp_bind_back_q = mp_bind_back<Q::template fn, T...>;
// mp_arg
template<std::size_t I> struct mp_arg
{
@@ -54,6 +73,16 @@ template<template<class...> class F, class... U, class... T> struct eval_bound_a
using type = typename mp_bind<F, U...>::template fn<T...>;
};
template<template<class...> class F, class... U, class... T> struct eval_bound_arg<mp_bind_front<F, U...>, T...>
{
using type = typename mp_bind_front<F, U...>::template fn<T...>;
};
template<template<class...> class F, class... U, class... T> struct eval_bound_arg<mp_bind_back<F, U...>, T...>
{
using type = typename mp_bind_back<F, U...>::template fn<T...>;
};
} // namespace detail
template<template<class...> class F, class... T> struct mp_bind
@@ -63,25 +92,6 @@ template<template<class...> class F, class... T> struct mp_bind
template<class Q, class... T> using mp_bind_q = mp_bind<Q::template fn, T...>;
// mp_bind_front
template<template<class...> 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<class... U> using fn = typename mp_defer<F, T..., U...>::type;
};
template<class Q, class... T> using mp_bind_front_q = mp_bind_front<Q::template fn, T...>;
// mp_bind_back
template<template<class...> class F, class... T> struct mp_bind_back
{
template<class... U> using fn = typename mp_defer<F, U..., T...>::type;
};
template<class Q, class... T> using mp_bind_back_q = mp_bind_back<Q::template fn, T...>;
} // namespace mp11
} // namespace boost

View File

@@ -79,7 +79,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, < 70300 )
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) || BOOST_WORKAROUND( BOOST_GCC, < 70400 )
template<class... T> using mp_all = mp_bool< mp_count_if< mp_list<T...>, mp_not >::value == 0 >;
@@ -124,7 +124,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, < 70300 )
#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_WORKAROUND( BOOST_GCC, < 70400 )
template<class... T> using mp_any = mp_bool<(static_cast<bool>(T::value) || ...)>;