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)
5 #ifndef BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_FUNCTOR_HPP
6 #define BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_FUNCTOR_HPP
10 #include <boost/hana/functional/flip.hpp>
11 #include <boost/hana/functional/partial.hpp>
12 #include <boost/hana/concept/functor.hpp>
17 namespace boost { namespace hana {
18 template <unsigned Rows, unsigned Columns>
19 struct transform_impl<cppcon::Matrix<Rows, Columns>> {
20 template <typename M, typename F>
21 static constexpr decltype(auto) apply(M&& m, F&& f) {
24 cppcon::rows(std::forward<M>(m)),
25 partial(flip(transform), std::forward<F>(f))
33 #endif // !BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_FUNCTOR_HPP