3 Forward declares `boost::hana::mult`.
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_MULT_HPP
11 #define BOOST_HANA_FWD_MULT_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 namespace boost { namespace hana {
18 //! Associative operation of a `Ring`.
19 //! @ingroup group-Ring
22 //! Two `Ring` elements to combine with the `Ring` binary operation.
25 //! Cross-type version of the method
26 //! --------------------------------
27 //! The `mult` method is "overloaded" to handle distinct data types
28 //! with certain properties. Specifically, `mult` is defined for
29 //! _distinct_ data types `A` and `B` such that
30 //! 1. `A` and `B` share a common data type `C`, as determined by the
31 //! `common` metafunction
32 //! 2. `A`, `B` and `C` are all `Ring`s when taken individually
33 //! 3. `to<C> : A -> B` and `to<C> : B -> C` are `Ring`-embeddings, as
34 //! determined by the `is_embedding` metafunction.
36 //! The definition of `mult` for data types satisfying the above
37 //! properties is obtained by setting
39 //! mult(x, y) = mult(to<C>(x), to<C>(y))
45 //! @include example/mult.cpp
46 #ifdef BOOST_HANA_DOXYGEN_INVOKED
47 constexpr auto mult = [](auto&& x, auto&& y) -> decltype(auto) {
48 return tag-dispatched;
51 template <typename T, typename U, typename = void>
52 struct mult_impl : mult_impl<T, U, when<true>> { };
55 template <typename X, typename Y>
56 constexpr decltype(auto) operator()(X&& x, Y&& y) const;
59 BOOST_HANA_INLINE_VARIABLE constexpr mult_t mult{};
61 }} // end namespace boost::hana
63 #endif // !BOOST_HANA_FWD_MULT_HPP