]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/example/cppcon_2014/functor.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / example / cppcon_2014 / functor.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
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
5#include <boost/hana/assert.hpp>
6#include <boost/hana/functional/placeholder.hpp>
7#include <boost/hana/integral_constant.hpp>
8
9#include "matrix/comparable.hpp"
10#include "matrix/functor.hpp"
11namespace hana = boost::hana;
12using namespace cppcon;
13
14
15int main() {
16 // transform
17 {
b32b8144 18 BOOST_HANA_CONSTEXPR_LAMBDA auto m = matrix(
7c673cae
FG
19 row(1, hana::int_c<2>, 3),
20 row(hana::int_c<4>, 5, 6),
21 row(7, 8, hana::int_c<9>)
22 );
23
24 BOOST_HANA_CONSTEXPR_CHECK(hana::equal(
25 hana::transform(m, hana::_ + hana::int_c<1>),
26 matrix(
27 row(2, hana::int_c<3>, 4),
28 row(hana::int_c<5>, 6, 7),
29 row(8, 9, hana::int_c<10>)
30 )
31 ));
32 }
33}