Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
check_less_than_comparable.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6/**************************************************************************************************/
7
8#include <adobe/config.hpp>
10#include <boost/test/unit_test.hpp>
11
12
13namespace adobe {
14
19
20template <typename T, typename Op>
21void check_transitive(const T& x, const T& y, const T& z, Op op) {
23 assert(op(x, y) && op(y, z));
24 BOOST_CHECK_MESSAGE(op(x, z), "tranisitive");
25}
26
27template <typename T, typename Op>
28void check_irreflexive(const T& x, Op op) {
29 BOOST_CHECK_MESSAGE(!op(x, x), "irreflexive");
30}
31
32template <typename T, typename Op>
33void check_antisymmetric(const T& x, const T& y, Op op) {
34 BOOST_CHECK_MESSAGE(!(op(x, y) && op(y, x)), "anti-symmetric");
35}
36
37
38template <typename T, typename Op>
39void check_less_than_comparable(const T& x, const T& y, const T& z, Op op) {
40 check_irreflexive(x, op);
41 check_antisymmetric(x, y, op);
42 check_transitive(x, y, z, op);
43}
44
46} // namespace adobe
void check_transitive(const T &x, const T &y, const T &z, Op op)
void check_antisymmetric(const T &x, const T &y, Op op)
void check_irreflexive(const T &x, Op op)
void ignore_unused(const T0 &)
void check_less_than_comparable(const T &x, const T &y, const T &z, Op op)