Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:43:35

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