Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:01:22

0001 // Boost.TypeErasure library
0002 //
0003 // Copyright 2018 Steven Watanabe
0004 //
0005 // Distributed under the Boost Software License Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // $Id$
0010 
0011 #ifndef BOOST_TYPE_ERASURE_DETAIL_META_HPP_INCLUDED
0012 #define BOOST_TYPE_ERASURE_DETAIL_META_HPP_INCLUDED
0013 
0014 #include <boost/config.hpp>
0015 
0016 
0017 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
0018     !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && \
0019     /* MSVC 14.0 breaks down in the template alias quagmire. */ \
0020     !BOOST_WORKAROUND(BOOST_MSVC, <= 1900)
0021 
0022 #define BOOST_TYPE_ERASURE_USE_MP11
0023 
0024 #include <boost/mp11/list.hpp>
0025 #include <boost/mp11/map.hpp>
0026 #include <boost/mp11/set.hpp>
0027 #include <boost/mp11/algorithm.hpp>
0028 #include <boost/mp11/function.hpp>
0029 #include <boost/mp11/mpl.hpp>
0030 
0031 namespace boost {
0032 namespace type_erasure {
0033 namespace detail {
0034 
0035 struct mp11_list_inserter
0036 {
0037     template<class L, class T>
0038     using apply = ::boost::mpl::identity< ::boost::mp11::mp_push_back<L, T> >;
0039 };
0040 
0041 template<class T>
0042 struct make_mp_list_impl
0043 {
0044     typedef typename ::boost::mpl::fold<
0045         T,
0046         ::boost::mp11::mp_list<>,
0047         ::boost::type_erasure::detail::mp11_list_inserter
0048     >::type type;
0049 };
0050 
0051 template<class... T>
0052 struct make_mp_list_impl< ::boost::mp11::mp_list<T...> >
0053 {
0054     typedef ::boost::mp11::mp_list<T...> type;
0055 };
0056 
0057 template<class T>
0058 using make_mp_list = typename make_mp_list_impl<T>::type;
0059 
0060 template<bool>
0061 struct eval_if_impl;
0062 
0063 template<>
0064 struct eval_if_impl<true>
0065 {
0066     template<template<class...> class T, template<class...> class F, class... A>
0067     using apply = T<A...>;
0068 };
0069 
0070 template<>
0071 struct eval_if_impl<false>
0072 {
0073     template<template<class...> class T, template<class...> class F, class... A>
0074     using apply = F<A...>;
0075 };
0076 
0077 template<bool B, template<class...> class T, template<class...> class F, class... A>
0078 using eval_if = typename ::boost::type_erasure::detail::eval_if_impl<B>::template apply<T, F, A...>;
0079 
0080 template<class T0, class...>
0081 using first = T0;
0082 
0083 }
0084 }
0085 }
0086 
0087 #endif
0088 
0089 #endif