]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_quote.cpp
2 // Copyright 2015, 2017 Peter Dimov.
4 // Distributed under the Boost Software License, Version 1.0.
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
10 #include <boost/mp11/utility.hpp>
11 #include <boost/mp11/detail/config.hpp>
12 #include <boost/core/lightweight_test_trait.hpp>
13 #include <type_traits>
15 using boost::mp11::mp_invoke_q
;
17 template<class...> struct X
{};
19 template<template<class...> class F
, class... T
> using Y
= X
<F
<T
>...>;
21 template<class Q
, class... T
> using Z
= X
<mp_invoke_q
<Q
, T
>...>;
23 template<class T
, class U
> struct P
{};
25 template<class T
, class U
> using first
= T
;
29 using boost::mp11::mp_identity_t
;
30 using boost::mp11::mp_quote
;
33 using Q
= mp_quote
<mp_identity_t
>;
35 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_invoke_q
<Q
, void>, void>));
36 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_invoke_q
<Q
, int[]>, int[]>));
40 using Q
= mp_quote
<mp_identity_t
>;
42 #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
43 using R1
= Y
<Q::fn
, void, char, int>;
44 BOOST_TEST_TRAIT_TRUE((std::is_same
<R1
, X
<void, char, int>>));
47 #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 && BOOST_MP11_MSVC >= 1900 )
48 using R2
= Z
<Q
, void, char, int>;
49 BOOST_TEST_TRAIT_TRUE((std::is_same
<R2
, X
<void, char, int>>));
54 using Q
= mp_quote
<P
>;
56 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_invoke_q
<Q
, void, void>, P
<void, void>>));
57 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_invoke_q
<Q
, char[], int[]>, P
<char[], int[]>>));
61 using Q
= mp_quote
<first
>;
63 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_invoke_q
<Q
, void, int>, void>));
64 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_invoke_q
<Q
, char[], int[]>, char[]>));
67 return boost::report_errors();