Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:03

0001 /*!
0002 @file
0003 Defines `boost::hana::intersection`.
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_INTERSECTION_HPP
0011 #define BOOST_HANA_INTERSECTION_HPP
0012 
0013 #include <boost/hana/fwd/intersection.hpp>
0014 
0015 #include <boost/hana/config.hpp>
0016 #include <boost/hana/core/dispatch.hpp>
0017 
0018 
0019 namespace boost { namespace hana {
0020     //! @cond
0021     template <typename Xs, typename Ys>
0022     constexpr auto intersection_t::operator()(Xs&& xs, Ys&& ys) const {
0023         using S = typename hana::tag_of<Xs>::type;
0024         using Intersection = BOOST_HANA_DISPATCH_IF(intersection_impl<S>,
0025             true
0026         );
0027 
0028         return Intersection::apply(static_cast<Xs&&>(xs), static_cast<Ys&&>(ys));
0029     }
0030     //! @endcond
0031 
0032     template <typename S, bool condition>
0033     struct intersection_impl<S, when<condition>> : default_ {
0034         template <typename ...Args>
0035         static constexpr auto apply(Args&& ...) = delete;
0036     };
0037 }} // end namespace boost::hana
0038 
0039 #endif // !BOOST_HANA_INTERSECTION_HPP