2
0
mirror of https://github.com/boostorg/hana.git synced 2026-01-23 05:32:13 +00:00
Files
hana/example/cppcon_2014/comparable.cpp
Louis Dionne 08b3db1708 [Examples] Modularize and use qualified names
This patch modularizes the examples, makes them self-contained and
also uses qualified hana:: names.

Fixes #139
Fixes #126
2015-08-15 17:50:40 +02:00

58 lines
1.4 KiB
C++

/*
@copyright Louis Dionne 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#include <boost/hana/assert.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/not.hpp>
#include "matrix/comparable.hpp"
namespace hana = boost::hana;
using namespace cppcon;
int main() {
BOOST_HANA_CONSTEXPR_CHECK(hana::equal(
matrix(row(1, 2)),
matrix(row(1, 2))
));
BOOST_HANA_CONSTEXPR_CHECK(hana::not_(hana::equal(
matrix(row(1, 2)),
matrix(row(1, 5))
)));
BOOST_HANA_CONSTEXPR_CHECK(hana::equal(
matrix(row(1, 2),
row(3, 4)),
matrix(row(1, 2),
row(3, 4))
));
BOOST_HANA_CONSTEXPR_CHECK(hana::not_(hana::equal(
matrix(row(1, 2),
row(3, 4)),
matrix(row(1, 2),
row(0, 4))
)));
BOOST_HANA_CONSTEXPR_CHECK(hana::not_(hana::equal(
matrix(row(1, 2),
row(3, 4)),
matrix(row(0, 2),
row(3, 4))
)));
BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
matrix(row(1),
row(2)),
matrix(row(3, 4),
row(5, 6))
)));
BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
matrix(row(1),
row(2)),
matrix(row(3, 4))
)));
}