2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-16 01:22:11 +00:00
Files
hana/test/integer_list/list/cons.cpp
2014-06-26 01:29:05 -04:00

29 lines
903 B
C++

/*
@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/integer_list.hpp>
#include <boost/hana/detail/static_assert.hpp>
#include <boost/hana/integral.hpp>
using namespace boost::hana;
template <typename T, typename U>
void test() {
BOOST_HANA_STATIC_ASSERT(cons(integral<T, 0>, integer_list<U>) == integer_list<U, 0>);
BOOST_HANA_STATIC_ASSERT(cons(integral<T, 0>, integer_list<U, 1>) == integer_list<U, 0, 1>);
BOOST_HANA_STATIC_ASSERT(cons(integral<T, 0>, integer_list<U, 1, 2>) == integer_list<U, 0, 1, 2>);
BOOST_HANA_STATIC_ASSERT(cons(integral<T, 0>, integer_list<U, 1, 2, 3>) == integer_list<U, 0, 1, 2, 3>);
}
int main() {
test<int, int>();
test<int, unsigned int>();
test<int, long>();
test<int, unsigned long>();
}