3 Forward declares `boost::hana::intersection`.
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_INTERSECTION_HPP
11 #define BOOST_HANA_FWD_INTERSECTION_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Returns the intersection of two sets.
19 //! @relates hana::set
21 //! Given two sets `xs` and `ys`, `intersection(xs, ys)` is a new set
22 //! containing exactly those elements that are present both in `xs` and
23 //! in `ys`. In other words, the following holds for any object `x`:
25 //! x ^in^ intersection(xs, ys) if and only if x ^in^ xs && x ^in^ ys
30 //! Two sets to intersect.
35 //! @include example/intersection.cpp
36 #ifdef BOOST_HANA_DOXYGEN_INVOKED
37 constexpr auto intersection = [](auto&& xs, auto&& ys) {
38 return tag-dispatched;
41 template <typename S, typename = void>
42 struct intersection_impl : intersection_impl<S, when<true>> { };
44 struct intersection_t {
45 template <typename Xs, typename Ys>
46 constexpr auto operator()(Xs&& xs, Ys&& ys) const;
49 constexpr intersection_t intersection{};
51 BOOST_HANA_NAMESPACE_END
53 #endif // !BOOST_HANA_FWD_INTERSECTION_HPP