Stratosphere: Add WrapIpcCommandImpl templating.

This commit is contained in:
Michael Scire
2018-04-20 19:34:29 -06:00
parent b5d3ce04e8
commit 7a2cfa4d60
80 changed files with 6694 additions and 162 deletions

View File

@@ -0,0 +1,31 @@
/*
Copyright Barrett Adair 2015-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
#define BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
#undef BOOST_CLBL_TRTS_DISJUNCTION
#define BOOST_CLBL_TRTS_DISJUNCTION(...) \
::boost::callable_traits::detail::disjunction<__VA_ARGS__>
namespace boost { namespace callable_traits { namespace detail {
//polyfill for C++17 std::disjunction
template<typename...>
struct disjunction : std::false_type {};
template<typename T>
struct disjunction<T> : T {};
template<typename T, typename... Ts>
struct disjunction<T, Ts...>
: std::conditional<T::value != false, T, disjunction<Ts...>>::type {};
}}} // namespace boost::callable_traits::detail
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP

View File

@@ -0,0 +1,50 @@
/*
Copyright Barrett Adair 2016-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP
#define BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP
#undef BOOST_CLBL_TRTS_IX_SEQ
#define BOOST_CLBL_TRTS_IX_SEQ(...) \
::boost::callable_traits::detail::index_sequence<__VA_ARGS__>
#undef BOOST_CLBL_TRTS_MAKE_IX_SEQ
#define BOOST_CLBL_TRTS_MAKE_IX_SEQ(...) \
::boost::callable_traits::detail::make_index_sequence<__VA_ARGS__>
namespace boost { namespace callable_traits { namespace detail {
template<std::size_t...>
struct index_sequence { using type = index_sequence; };
template<typename, typename>
struct concat;
template<std::size_t... I1, std::size_t... I2>
struct concat<index_sequence<I1...>, index_sequence<I2...>>
: index_sequence<I1..., (sizeof...(I1)+I2)...> {};
template<std::size_t N>
struct make_index_sequence_t;
template<std::size_t N>
struct make_index_sequence_t : concat<
typename make_index_sequence_t<N/2>::type,
typename make_index_sequence_t<N - N/2>::type >::type {};
template<>
struct make_index_sequence_t<0> : index_sequence<> {};
template<>
struct make_index_sequence_t<1> : index_sequence<0> {};
template<std::size_t... I>
using make_index_sequence = typename make_index_sequence_t<I...>::type;
}}} // namespace boost::callable_traits::detail
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP