3 Forward declares `boost::hana::remove`.
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_REMOVE_HPP
11 #define BOOST_HANA_FWD_REMOVE_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Remove all the elements of a monadic structure that are equal to some
20 //! @ingroup group-MonadPlus
22 //! Given a monadic structure `xs` and a `value`, `remove` returns a new
23 //! monadic structure equal to `xs` without all its elements that are
24 //! equal to the given `value`. `remove` is equivalent to `remove_if`
25 //! with the `equal.to(value)` predicate, i.e.
27 //! remove(xs, value) == remove_if(xs, equal.to(value))
33 //! Given a MonadPlus `M` and a value of type `T`, the signature is
35 //! \mathrm{remove} : M(T) \times T \to M(T)
39 //! A monadic structure to remove some elements from.
42 //! A value that is compared to every element `x` of the structure.
43 //! Elements of the structure that are equal to that value are removed
44 //! from the structure. This requires every element to be Comparable
45 //! with `value`. Furthermore, in the current version of the library,
46 //! comparing `value` with any element of the structure must yield a
47 //! compile-time Logical.
52 //! @include example/remove.cpp
53 #ifdef BOOST_HANA_DOXYGEN_INVOKED
54 constexpr auto remove = [](auto&& xs, auto&& value) {
55 return tag-dispatched;
58 template <typename M, typename = void>
59 struct remove_impl : remove_impl<M, when<true>> { };
62 template <typename Xs, typename Value>
63 constexpr auto operator()(Xs&& xs, Value&& value) const;
66 constexpr remove_t remove{};
68 BOOST_HANA_NAMESPACE_END
70 #endif // !BOOST_HANA_FWD_REMOVE_HPP