3 Forward declares `boost::hana::remove_at` and `boost::hana::remove_at_c`.
5 @copyright Louis Dionne 2013-2016
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_FWD_REMOVE_AT_HPP
11 #define BOOST_HANA_FWD_REMOVE_AT_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
19 BOOST_HANA_NAMESPACE_BEGIN
20 //! Remove the element at a given index from a sequence.
21 //! @ingroup group-Sequence
23 //! `remove_at` returns a new sequence identical to the original, except
24 //! that the element at the given index is removed. Specifically,
25 //! `remove_at([x0, ..., xn-1, xn, xn+1, ..., xm], n)` is a new
26 //! sequence equivalent to `[x0, ..., xn-1, xn+1, ..., xm]`.
29 //! The behavior is undefined if the index is out of the bounds of the
34 //! A sequence from which an element is to be removed.
37 //! An non-negative `IntegralConstant` representing the index of the
38 //! element to be removed from the sequence. The behavior is undefined
39 //! if that index is not in the bounds of the sequence.
44 //! @include example/remove_at.cpp
45 #ifdef BOOST_HANA_DOXYGEN_INVOKED
46 constexpr auto remove_at = [](auto&& xs, auto const& n) {
47 return tag-dispatched;
50 template <typename S, typename = void>
51 struct remove_at_impl : remove_at_impl<S, when<true>> { };
54 template <typename Xs, typename N>
55 constexpr auto operator()(Xs&& xs, N const& n) const;
58 constexpr remove_at_t remove_at{};
61 //! Equivalent to `remove_at`; provided for convenience.
62 //! @ingroup group-Sequence
67 //! @include example/remove_at_c.cpp
68 #ifdef BOOST_HANA_DOXYGEN_INVOKED
69 template <std::size_t n>
70 constexpr auto remove_at_c = [](auto&& xs) {
71 return hana::remove_at(forwarded(xs), hana::size_c<n>);
74 template <std::size_t n>
77 template <std::size_t n>
78 constexpr remove_at_c_t<n> remove_at_c{};
80 BOOST_HANA_NAMESPACE_END
82 #endif // !BOOST_HANA_FWD_REMOVE_AT_HPP