]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/include/boost/hana/symmetric_difference.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / hana / include / boost / hana / symmetric_difference.hpp
1 /*!
2 @file
3 Defines `boost::hana::symmetric_difference`.
4
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)
8 */
9
10 #ifndef BOOST_HANA_SYMMETRIC_DIFFERENCE_HPP
11 #define BOOST_HANA_SYMMETRIC_DIFFERENCE_HPP
12
13 #include <boost/hana/fwd/symmetric_difference.hpp>
14
15 #include <boost/hana/config.hpp>
16 #include <boost/hana/core/dispatch.hpp>
17 #include <boost/hana/difference.hpp>
18 #include <boost/hana/union.hpp>
19
20
21 BOOST_HANA_NAMESPACE_BEGIN
22 //! @cond
23 template <typename Xs, typename Ys>
24 constexpr auto symmetric_difference_t::operator()(Xs&& xs, Ys&& ys) const {
25 using S = typename hana::tag_of<Xs>::type;
26 using SymmetricDifference = BOOST_HANA_DISPATCH_IF(symmetric_difference_impl<S>,
27 true
28 );
29
30 return SymmetricDifference::apply(static_cast<Xs&&>(xs), static_cast<Ys&&>(ys));
31 }
32 //! @endcond
33
34 template <typename S, bool condition>
35 struct symmetric_difference_impl<S, when<condition>> : default_ {
36 template <typename Xs, typename Ys>
37 static constexpr auto apply(Xs&& xs, Ys&& ys) {
38 return hana::union_(
39 hana::difference(xs, ys),
40 hana::difference(ys, xs)
41 );
42 }
43 };
44 BOOST_HANA_NAMESPACE_END
45
46 #endif // !BOOST_HANA_SYMMETRIC_DIFFERENCE_HPP