mirror of
https://github.com/boostorg/hana.git
synced 2026-02-23 15:52:11 +00:00
Comparable: Check laws widely
This commit is contained in:
41
test/ext/std/integer_sequence/comparable/laws.cpp
Normal file
41
test/ext/std/integer_sequence/comparable/laws.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
@copyright Louis Dionne 2014
|
||||
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/ext/std/integer_sequence.hpp>
|
||||
|
||||
#include <boost/hana/comparable/laws.hpp>
|
||||
#include <boost/hana/detail/static_assert.hpp>
|
||||
#include <boost/hana/list/instance.hpp>
|
||||
|
||||
#include <utility>
|
||||
using namespace boost::hana;
|
||||
|
||||
|
||||
template <typename T, typename U>
|
||||
void test() {
|
||||
BOOST_HANA_STATIC_ASSERT(
|
||||
Comparable::laws::check(
|
||||
list(
|
||||
std::integer_sequence<T>{},
|
||||
std::integer_sequence<U>{},
|
||||
|
||||
std::integer_sequence<T, 0>{},
|
||||
std::integer_sequence<U, 0>{},
|
||||
|
||||
std::integer_sequence<T, 0, 1>{},
|
||||
std::integer_sequence<U, 0, 1>{},
|
||||
|
||||
std::integer_sequence<T, 1, 0, 2>{},
|
||||
std::integer_sequence<U, 1, 0, 2>{}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
int main() {
|
||||
test<int, int>();
|
||||
test<int, unsigned long long>();
|
||||
}
|
||||
Reference in New Issue
Block a user