Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:03

0001 /*!
0002 @file
0003 Forward declares `boost::hana::drop_while`.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_FWD_DROP_WHILE_HPP
0011 #define BOOST_HANA_FWD_DROP_WHILE_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! Drop elements from an iterable up to, but excluding, the first
0019     //! element for which the `predicate` is not satisfied.
0020     //! @ingroup group-Iterable
0021     //!
0022     //! Specifically, `drop_while` returns an iterable containing all the
0023     //! elements of the original iterable except for those in the range
0024     //! delimited by [`head`, `e`), where `head` is the first element and
0025     //! `e` is the first element for which the `predicate` is not satisfied.
0026     //! If the iterable is not finite, the `predicate` has to return a false-
0027     //! valued `Logical` at a finite index for this method to return.
0028     //!
0029     //!
0030     //! @param iterable
0031     //! The iterable from which elements are dropped.
0032     //!
0033     //! @param predicate
0034     //! A function called as `predicate(x)`, where `x` is an element of the
0035     //! structure, and returning a `Logical` representing whether `x` should
0036     //! be dropped from the structure. In the current version of the library,
0037     //! `predicate` should return a compile-time `Logical`.
0038     //!
0039     //!
0040     //! Example
0041     //! -------
0042     //! @include example/drop_while.cpp
0043 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0044     constexpr auto drop_while = [](auto&& iterable, auto&& predicate) {
0045         return tag-dispatched;
0046     };
0047 #else
0048     template <typename It, typename = void>
0049     struct drop_while_impl : drop_while_impl<It, when<true>> { };
0050 
0051     struct drop_while_t {
0052         template <typename Xs, typename Pred>
0053         constexpr auto operator()(Xs&& xs, Pred&& pred) const;
0054     };
0055 
0056     BOOST_HANA_INLINE_VARIABLE constexpr drop_while_t drop_while{};
0057 #endif
0058 }} // end namespace boost::hana
0059 
0060 #endif // !BOOST_HANA_FWDDROP_WHILE_HPP