Add support for value lists to mp_front. Refs #53.

This commit is contained in:
Peter Dimov
2023-05-15 14:52:26 +03:00
parent 481755ce7c
commit 2c76388fdb
3 changed files with 54 additions and 1 deletions

View File

@@ -1,13 +1,16 @@
#ifndef BOOST_MP11_DETAIL_MP_FRONT_HPP_INCLUDED
#define BOOST_MP11_DETAIL_MP_FRONT_HPP_INCLUDED
// Copyright 2015-2021 Peter Dimov.
// Copyright 2015-2023 Peter Dimov.
//
// Distributed under the Boost Software License, Version 1.0.
//
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/mp11/detail/mp_value.hpp>
#include <boost/mp11/detail/config.hpp>
namespace boost
{
namespace mp11
@@ -28,6 +31,15 @@ template<template<class...> class L, class T1, class... T> struct mp_front_impl<
using type = T1;
};
#if defined(BOOST_MP11_HAS_TEMPLATE_AUTO)
template<template<auto...> class L, auto A1, auto... A> struct mp_front_impl<L<A1, A...>>
{
using type = mp_value<A1>;
};
#endif
} // namespace detail
template<class L> using mp_front = typename detail::mp_front_impl<L>::type;