Document mp_back, mp_pop_back

This commit is contained in:
Peter Dimov
2019-02-16 20:26:03 +02:00
parent dda257c403
commit ed431d7624
3 changed files with 15 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
////
Copyright 2017 Peter Dimov
Copyright 2017-2019 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
@@ -367,6 +367,18 @@ Same as `mp_at_c`, but with a type argument `I`. `I::value` must be a nonnegativ
Same as `mp_take_c`, but with a type argument `N`. `N::value` must be a nonnegative number.
## mp_back<L>
template<class L> using mp_back = mp_at_c<L, mp_size<L>::value - 1>;
`mp_back<L>` returns the last element of the list `L`.
## mp_pop_back<L>
template<class L> using mp_pop_back = mp_take_c<L, mp_size<L>::value - 1>;
`mp_pop_back<L>` removes the last element of the list `L` and returns the result.
## mp_insert_c<L, I, T...>
template<class L, std::size_t I, class... T> using mp_insert_c =

View File

@@ -19,6 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt
* Add `mp_transform_first`, `mp_transform_second`, `mp_transform_third`
* Add `mp_filter`
* Add `mp_eval_if_not`, `mp_eval_or`, `mp_valid_q`
* Add `mp_back`, `mp_pop_back`
## Changes in 1.69.0

View File

@@ -1,7 +1,7 @@
#ifndef BOOST_MP11_ALGORITHM_HPP_INCLUDED
#define BOOST_MP11_ALGORITHM_HPP_INCLUDED
// Copyright 2015-2017 Peter Dimov.
// Copyright 2015-2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
//