diff --git a/doc/mp11/algorithm.adoc b/doc/mp11/algorithm.adoc index 15a68e1..2b2b89a 100644 --- a/doc/mp11/algorithm.adoc +++ b/doc/mp11/algorithm.adoc @@ -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 + + template using mp_back = mp_at_c::value - 1>; + +`mp_back` returns the last element of the list `L`. + +## mp_pop_back + + template using mp_pop_back = mp_take_c::value - 1>; + +`mp_pop_back` removes the last element of the list `L` and returns the result. + ## mp_insert_c template using mp_insert_c = diff --git a/doc/mp11/changelog.adoc b/doc/mp11/changelog.adoc index 69ece4a..c19f30d 100644 --- a/doc/mp11/changelog.adoc +++ b/doc/mp11/changelog.adoc @@ -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 diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 539bf58..b8719d6 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -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. //