3 Forward declares `boost::hana::insert_range`.
5 @copyright Louis Dionne 2013-2017
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_INSERT_RANGE_HPP
11 #define BOOST_HANA_FWD_INSERT_RANGE_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Insert several values at a given index in a sequence.
19 //! @ingroup group-Sequence
21 //! Given a sequence, an index and any `Foldable` containing elements to
22 //! insert, `insert_range` inserts the elements in the `Foldable` at the
23 //! given index of the sequence.
26 //! The sequence in which values should be inserted.
29 //! The index at which elements should be inserted. This must be a
30 //! non-negative `Constant` of an integral type, and it must also be
31 //! true that `n < length(xs)` if `xs` is a finite sequence.
34 //! A `Foldable` containing elements to insert in the sequence.
39 //! @include example/insert_range.cpp
40 #ifdef BOOST_HANA_DOXYGEN_INVOKED
41 constexpr auto insert_range = [](auto&& xs, auto&& n, auto&& elements) {
42 return tag-dispatched;
45 template <typename S, typename = void>
46 struct insert_range_impl : insert_range_impl<S, when<true>> { };
48 struct insert_range_t {
49 template <typename Xs, typename N, typename Elements>
50 constexpr auto operator()(Xs&& xs, N&& n, Elements&& elements) const;
53 constexpr insert_range_t insert_range{};
55 BOOST_HANA_NAMESPACE_END
57 #endif // !BOOST_HANA_FWD_INSERT_RANGE_HPP