Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:46:50

0001 #ifndef BOOST_MP11_DETAIL_MP_FRONT_HPP_INCLUDED
0002 #define BOOST_MP11_DETAIL_MP_FRONT_HPP_INCLUDED
0003 
0004 //  Copyright 2015-2023 Peter Dimov.
0005 //
0006 //  Distributed under the Boost Software License, Version 1.0.
0007 //
0008 //  See accompanying file LICENSE_1_0.txt or copy at
0009 //  http://www.boost.org/LICENSE_1_0.txt
0010 
0011 #include <boost/mp11/detail/mp_value.hpp>
0012 #include <boost/mp11/detail/config.hpp>
0013 
0014 namespace boost
0015 {
0016 namespace mp11
0017 {
0018 
0019 // mp_front<L>
0020 namespace detail
0021 {
0022 
0023 template<class L> struct mp_front_impl
0024 {
0025 // An error "no type named 'type'" here means that the argument to mp_front
0026 // is either not a list, or is an empty list
0027 };
0028 
0029 template<template<class...> class L, class T1, class... T> struct mp_front_impl<L<T1, T...>>
0030 {
0031     using type = T1;
0032 };
0033 
0034 #if defined(BOOST_MP11_HAS_TEMPLATE_AUTO)
0035 
0036 template<template<auto...> class L, auto A1, auto... A> struct mp_front_impl<L<A1, A...>>
0037 {
0038     using type = mp_value<A1>;
0039 };
0040 
0041 #endif
0042 
0043 } // namespace detail
0044 
0045 template<class L> using mp_front = typename detail::mp_front_impl<L>::type;
0046 
0047 } // namespace mp11
0048 } // namespace boost
0049 
0050 #endif // #ifndef BOOST_MP11_DETAIL_MP_FRONT_HPP_INCLUDED