group.hpp 840 B

12345678910111213141516171819202122232425262728
  1. // Copyright Louis Dionne 2013-2017
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  4. #ifndef BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_GROUP_HPP
  5. #define BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_GROUP_HPP
  6. #include "matrix.hpp"
  7. #include <boost/hana/concept/group.hpp>
  8. #include <utility>
  9. namespace boost { namespace hana {
  10. template <unsigned R, unsigned C>
  11. struct minus_impl<cppcon::Matrix<R, C>, cppcon::Matrix<R, C>> {
  12. template <typename M1, typename M2>
  13. static constexpr decltype(auto) apply(M1&& m1, M2&& m2) {
  14. return element_wise(minus)(
  15. std::forward<M1>(m1),
  16. std::forward<M2>(m2)
  17. );
  18. }
  19. };
  20. }}
  21. #endif // !BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_GROUP_HPP