From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/boost/libs/hana/test/ext/std/array/at.cpp | 43 +++++++++ .../libs/hana/test/ext/std/array/comparable.cpp | 29 ++++++ .../libs/hana/test/ext/std/array/foldable.cpp | 29 ++++++ .../libs/hana/test/ext/std/array/issue_304.cpp | 21 +++++ .../libs/hana/test/ext/std/array/iterable.cpp | 83 +++++++++++++++++ .../libs/hana/test/ext/std/array/orderable.cpp | 29 ++++++ .../libs/hana/test/ext/std/array/searchable.cpp | 31 +++++++ .../libs/hana/test/ext/std/bugs/libcxx_19616.cpp | 21 +++++ .../libs/hana/test/ext/std/bugs/libcxx_22806.cpp | 21 +++++ .../std/integer_sequence/drop_front_exactly.cpp | 44 +++++++++ .../hana/test/ext/std/integer_sequence/equal.cpp | 52 +++++++++++ .../hana/test/ext/std/integer_sequence/find_if.cpp | 101 +++++++++++++++++++++ .../hana/test/ext/std/integer_sequence/front.cpp | 31 +++++++ .../test/ext/std/integer_sequence/is_empty.cpp | 18 ++++ .../hana/test/ext/std/integer_sequence/laws.cpp | 37 ++++++++ .../hana/test/ext/std/integer_sequence/unpack.cpp | 47 ++++++++++ .../test/ext/std/integral_constant/arithmetic.cpp | 31 +++++++ .../test/ext/std/integral_constant/comparable.cpp | 27 ++++++ .../test/ext/std/integral_constant/constant.cpp | 33 +++++++ .../test/ext/std/integral_constant/interop.cpp | 22 +++++ .../test/ext/std/integral_constant/logical.cpp | 63 +++++++++++++ .../test/ext/std/integral_constant/orderable.cpp | 25 +++++ .../hana/test/ext/std/integral_constant/tag.cpp | 53 +++++++++++ .../libs/hana/test/ext/std/pair/first_second.cpp | 30 ++++++ src/boost/libs/hana/test/ext/std/pair/issue_90.cpp | 44 +++++++++ src/boost/libs/hana/test/ext/std/pair/laws.cpp | 41 +++++++++ src/boost/libs/hana/test/ext/std/pair/make.cpp | 26 ++++++ src/boost/libs/hana/test/ext/std/ratio/div.cpp | 24 +++++ src/boost/libs/hana/test/ext/std/ratio/equal.cpp | 34 +++++++ src/boost/libs/hana/test/ext/std/ratio/laws.cpp | 37 ++++++++ src/boost/libs/hana/test/ext/std/ratio/less.cpp | 29 ++++++ src/boost/libs/hana/test/ext/std/ratio/minus.cpp | 19 ++++ src/boost/libs/hana/test/ext/std/ratio/mod.cpp | 24 +++++ src/boost/libs/hana/test/ext/std/ratio/mult.cpp | 19 ++++ src/boost/libs/hana/test/ext/std/ratio/one.cpp | 24 +++++ src/boost/libs/hana/test/ext/std/ratio/plus.cpp | 19 ++++ src/boost/libs/hana/test/ext/std/ratio/to.cpp | 36 ++++++++ src/boost/libs/hana/test/ext/std/ratio/zero.cpp | 24 +++++ .../libs/hana/test/ext/std/tuple/auto/_specs.hpp | 17 ++++ .../libs/hana/test/ext/std/tuple/auto/all_of.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/any_of.cpp | 8 ++ src/boost/libs/hana/test/ext/std/tuple/auto/ap.cpp | 8 ++ src/boost/libs/hana/test/ext/std/tuple/auto/at.cpp | 8 ++ .../test/ext/std/tuple/auto/cartesian_product.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/drop_back.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/drop_front.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/drop_while.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/for_each.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/group.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/index_if.cpp | 9 ++ .../libs/hana/test/ext/std/tuple/auto/insert.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/insert_range.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/intersperse.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/is_empty.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/length.cpp | 8 ++ .../ext/std/tuple/auto/lexicographical_compare.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/make.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/none_of.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/partition.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/permutations.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/remove_at.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/remove_range.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/reverse.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/scans.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/sequence.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/slice.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/sort.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/span.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/take_back.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/take_front.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/take_while.cpp | 8 ++ .../hana/test/ext/std/tuple/auto/transform.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/unfolds.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/unique.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/auto/zips.cpp | 8 ++ .../libs/hana/test/ext/std/tuple/issue_90.cpp | 73 +++++++++++++++ src/boost/libs/hana/test/ext/std/tuple/laws.cpp | 43 +++++++++ .../libs/hana/test/ext/std/tuple/laws.functor.cpp | 55 +++++++++++ .../hana/test/ext/std/tuple/laws.searchable.cpp | 38 ++++++++ src/boost/libs/hana/test/ext/std/vector.cpp | 44 +++++++++ 80 files changed, 1880 insertions(+) create mode 100644 src/boost/libs/hana/test/ext/std/array/at.cpp create mode 100644 src/boost/libs/hana/test/ext/std/array/comparable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/array/foldable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/array/issue_304.cpp create mode 100644 src/boost/libs/hana/test/ext/std/array/iterable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/array/orderable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/array/searchable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/bugs/libcxx_19616.cpp create mode 100644 src/boost/libs/hana/test/ext/std/bugs/libcxx_22806.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/drop_front_exactly.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/equal.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/find_if.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/front.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/is_empty.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/laws.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integer_sequence/unpack.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/arithmetic.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/comparable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/constant.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/interop.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/logical.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/orderable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/integral_constant/tag.cpp create mode 100644 src/boost/libs/hana/test/ext/std/pair/first_second.cpp create mode 100644 src/boost/libs/hana/test/ext/std/pair/issue_90.cpp create mode 100644 src/boost/libs/hana/test/ext/std/pair/laws.cpp create mode 100644 src/boost/libs/hana/test/ext/std/pair/make.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/div.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/equal.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/laws.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/less.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/minus.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/mod.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/mult.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/one.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/plus.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/to.cpp create mode 100644 src/boost/libs/hana/test/ext/std/ratio/zero.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/_specs.hpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/all_of.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/any_of.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/ap.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/at.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/cartesian_product.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/drop_back.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/drop_front.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/drop_while.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/for_each.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/group.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/index_if.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/insert.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/insert_range.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/intersperse.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/is_empty.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/length.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/lexicographical_compare.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/make.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/none_of.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/partition.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/permutations.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/remove_at.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/remove_range.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/reverse.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/scans.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/sequence.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/slice.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/sort.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/span.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/take_back.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/take_front.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/take_while.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/transform.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/unfolds.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/unique.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/auto/zips.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/issue_90.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/laws.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/laws.functor.cpp create mode 100644 src/boost/libs/hana/test/ext/std/tuple/laws.searchable.cpp create mode 100644 src/boost/libs/hana/test/ext/std/vector.cpp (limited to 'src/boost/libs/hana/test/ext/std') diff --git a/src/boost/libs/hana/test/ext/std/array/at.cpp b/src/boost/libs/hana/test/ext/std/array/at.cpp new file mode 100644 index 000000000..90ed1f5b7 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/at.cpp @@ -0,0 +1,43 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include +#include + +#include // for move_only + +#include +namespace hana = boost::hana; + + +int main() { + // Check non-const lvalue reference + { + std::array arr = {{999, 888}}; + int& i = hana::at_c<0>(arr); + BOOST_HANA_RUNTIME_CHECK(i == 999); + arr[0] = 333; + BOOST_HANA_RUNTIME_CHECK(i == 333); + i = 444; + BOOST_HANA_RUNTIME_CHECK(arr[0] == 444); + } + + // Check const lvalue reference + { + std::array arr = {{999, 888}}; + int const& i = hana::at_c<0>(static_cast const&>(arr)); + BOOST_HANA_RUNTIME_CHECK(i == 999); + arr[0] = 333; + BOOST_HANA_RUNTIME_CHECK(i == 333); + } + + // Check move-only types + { + std::array arr{}; + hana::test::move_only m = hana::at_c<0>(std::move(arr)); + (void)m; + } +} diff --git a/src/boost/libs/hana/test/ext/std/array/comparable.cpp b/src/boost/libs/hana/test/ext/std/array/comparable.cpp new file mode 100644 index 000000000..d0596fa6c --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/comparable.cpp @@ -0,0 +1,29 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include + +#include +namespace hana = boost::hana; + + +template +constexpr auto array() { return std::array{{i...}}; } + +int main() { + auto int_arrays = hana::make_tuple( + array<>() + , array<0>() + , array<0, 1>() + , array<0, 1, 2>() + , array<0, 1, 2, 3>() + , array<0, 1, 2, 3, 4>() + ); + + hana::test::TestComparable{int_arrays}; +} diff --git a/src/boost/libs/hana/test/ext/std/array/foldable.cpp b/src/boost/libs/hana/test/ext/std/array/foldable.cpp new file mode 100644 index 000000000..b36e9521f --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/foldable.cpp @@ -0,0 +1,29 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include + +#include +namespace hana = boost::hana; + + +template +constexpr auto array() { return std::array{{i...}}; } + +int main() { + auto int_arrays = hana::make_tuple( + array<>() + , array<0>() + , array<0, 1>() + , array<0, 1, 2>() + , array<0, 1, 2, 3>() + , array<0, 1, 2, 3, 4>() + ); + + hana::test::TestFoldable{int_arrays}; +} diff --git a/src/boost/libs/hana/test/ext/std/array/issue_304.cpp b/src/boost/libs/hana/test/ext/std/array/issue_304.cpp new file mode 100644 index 000000000..321f18f27 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/issue_304.cpp @@ -0,0 +1,21 @@ +// Copyright Jason Rice 2016 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) +// modified from https://github.com/boostorg/hana/issues/304 + +#include +#include + +namespace hana = boost::hana; + +struct Foo +{ + Foo() = default; + Foo(Foo const&) = delete; + Foo(Foo &&) = default; +}; + +using bar = decltype(hana::to_tuple(std::array())); + +int main() +{ } diff --git a/src/boost/libs/hana/test/ext/std/array/iterable.cpp b/src/boost/libs/hana/test/ext/std/array/iterable.cpp new file mode 100644 index 000000000..38bd7731d --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/iterable.cpp @@ -0,0 +1,83 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +namespace hana = boost::hana; + + +template +constexpr auto array() { return std::array{{i...}}; } + +int main() { + // is_empty + { + BOOST_HANA_CONSTANT_CHECK(hana::is_empty(array<>())); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(array<0>()))); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(array<0, 1>()))); + } + + // front + { + BOOST_HANA_CONSTEXPR_CHECK(hana::front(array<0>()) == 0); + BOOST_HANA_CONSTEXPR_CHECK(hana::front(array<0, 1>()) == 0); + BOOST_HANA_CONSTEXPR_CHECK(hana::front(array<0, 1, 2>()) == 0); + } + + // drop_front_exactly + { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(array<0>()), + array<>() + )); + BOOST_HANA_CONSTEXPR_CHECK(hana::equal( + hana::drop_front_exactly(array<0, 1>()), + array<1>() + )); + BOOST_HANA_CONSTEXPR_CHECK(hana::equal( + hana::drop_front_exactly(array<0, 1, 2>()), + array<1, 2>() + )); + BOOST_HANA_CONSTEXPR_CHECK(hana::equal( + hana::drop_front_exactly(array<0, 1, 2, 3>()), + array<1, 2, 3>() + )); + + + BOOST_HANA_CONSTEXPR_CHECK(hana::equal( + hana::drop_front_exactly(array<0, 1, 2, 3>(), hana::size_c<2>), + array<2, 3>() + )); + + BOOST_HANA_CONSTEXPR_CHECK(hana::equal( + hana::drop_front_exactly(array<0, 1, 2, 3>(), hana::size_c<3>), + array<3>() + )); + } + + // laws + auto int_arrays = hana::make_tuple( + array<>() + , array<0>() + , array<0, 1>() + , array<0, 1, 2>() + , array<0, 1, 2, 3>() + , array<0, 1, 2, 3, 4>() + ); + + hana::test::TestIterable{int_arrays}; +} diff --git a/src/boost/libs/hana/test/ext/std/array/orderable.cpp b/src/boost/libs/hana/test/ext/std/array/orderable.cpp new file mode 100644 index 000000000..ced9ab6b4 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/orderable.cpp @@ -0,0 +1,29 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include + +#include +namespace hana = boost::hana; + + +template +constexpr auto array() { return std::array{{i...}}; } + +int main() { + auto int_arrays = hana::make_tuple( + array<>() + , array<0>() + , array<0, 1>() + , array<0, 1, 2>() + , array<0, 1, 2, 3>() + , array<0, 1, 2, 3, 4>() + ); + + hana::test::TestOrderable{int_arrays}; +} diff --git a/src/boost/libs/hana/test/ext/std/array/searchable.cpp b/src/boost/libs/hana/test/ext/std/array/searchable.cpp new file mode 100644 index 000000000..1ba584fde --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/array/searchable.cpp @@ -0,0 +1,31 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include +#include + +#include +namespace hana = boost::hana; + + +template +constexpr auto array() { return std::array{{i...}}; } + +int main() { + auto eq_arrays = hana::make_tuple( + std::array, 0>{} + , std::array, 1>{} + , std::array, 2>{} + , std::array, 3>{} + , std::array, 4>{} + ); + + auto eq_keys = hana::make_tuple(hana::test::ct_eq<0>{}); + + hana::test::TestSearchable{eq_arrays, eq_keys}; +} diff --git a/src/boost/libs/hana/test/ext/std/bugs/libcxx_19616.cpp b/src/boost/libs/hana/test/ext/std/bugs/libcxx_19616.cpp new file mode 100644 index 000000000..2b91f88ad --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/bugs/libcxx_19616.cpp @@ -0,0 +1,21 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + // Make sure we workaround the bug at: + // http://llvm.org/bugs/show_bug.cgi?id=19616 + BOOST_HANA_CONSTEXPR_CHECK(hana::equal( + hana::lift(std::make_tuple(1)), + std::make_tuple(std::make_tuple(1)) + )); +} diff --git a/src/boost/libs/hana/test/ext/std/bugs/libcxx_22806.cpp b/src/boost/libs/hana/test/ext/std/bugs/libcxx_22806.cpp new file mode 100644 index 000000000..281481086 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/bugs/libcxx_22806.cpp @@ -0,0 +1,21 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include + +#include +namespace hana = boost::hana; + + +int main() { + using M = hana::ext::std::tuple_tag; + auto m = std::make_tuple(hana::test::ct_eq<0>{}); + auto f = hana::compose(hana::lift, hana::test::_injection<0>{}); + hana::chain(m, hana::compose(hana::lift, f)); +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/drop_front_exactly.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/drop_front_exactly.cpp new file mode 100644 index 000000000..a9556ccb7 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/drop_front_exactly.cpp @@ -0,0 +1,44 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(std::index_sequence<0>{}), + std::index_sequence<>{} + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(std::index_sequence<0, 1>{}), + std::index_sequence<1>{} + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(std::index_sequence<0, 1, 2>{}), + std::index_sequence<1, 2>{} + )); + + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(std::index_sequence<0, 1, 2>{}, hana::size_c<2>), + std::index_sequence<2>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(std::index_sequence<0, 1, 2, 3>{}, hana::size_c<2>), + std::index_sequence<2, 3>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::drop_front_exactly(std::index_sequence<0, 1, 2, 3>{}, hana::size_c<3>), + std::index_sequence<3>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/equal.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/equal.cpp new file mode 100644 index 000000000..7249d234d --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/equal.cpp @@ -0,0 +1,52 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +using T = int; +using U = long long; + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + )); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + )); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + )); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal( + std::integer_sequence{}, + std::integer_sequence{} + ))); +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/find_if.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/find_if.cpp new file mode 100644 index 000000000..4c904ed65 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/find_if.cpp @@ -0,0 +1,101 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include +#include + +#include +#include +#include +namespace hana = boost::hana; + + +struct undefined { }; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<>{}, + hana::equal.to(undefined{})), + hana::nothing + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0>{}, + hana::equal.to(std::integral_constant{})), + hana::nothing + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1>{}, + hana::equal.to(std::integral_constant{})), + hana::nothing + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2>{}, + hana::equal.to(std::integral_constant{})), + hana::nothing + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2, 3>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2, 3>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2, 3>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2, 3>{}, + hana::equal.to(std::integral_constant{})), + hana::just(std::integral_constant{}) + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::find_if(std::index_sequence<0, 1, 2, 3>{}, + hana::equal.to(std::integral_constant{})), + hana::nothing + )); +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/front.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/front.cpp new file mode 100644 index 000000000..69372c99b --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/front.cpp @@ -0,0 +1,31 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include + +#include +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::front(std::index_sequence<0>{}), + std::integral_constant{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::front(std::index_sequence<0, 1>{}), + std::integral_constant{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::front(std::integer_sequence{}), + std::integral_constant{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/is_empty.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/is_empty.cpp new file mode 100644 index 000000000..b6c79c755 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/is_empty.cpp @@ -0,0 +1,18 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::is_empty(std::index_sequence<>{})); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(std::index_sequence<0>{}))); + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(std::index_sequence<1>{}))); +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/laws.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/laws.cpp new file mode 100644 index 000000000..8cc7fcc43 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/laws.cpp @@ -0,0 +1,37 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +namespace hana = boost::hana; + + +auto sequences = hana::make_tuple( + std::integer_sequence{}, + std::integer_sequence{}, + std::integer_sequence{}, + std::integer_sequence{}, + std::integer_sequence{} +); + +auto keys = hana::make_tuple( + std::integral_constant{}, std::integral_constant{} +); + +int main() { + hana::test::TestComparable{sequences}; + hana::test::TestFoldable{sequences}; + hana::test::TestIterable{sequences}; + hana::test::TestSearchable{sequences, keys}; +} diff --git a/src/boost/libs/hana/test/ext/std/integer_sequence/unpack.cpp b/src/boost/libs/hana/test/ext/std/integer_sequence/unpack.cpp new file mode 100644 index 000000000..5ef9320c8 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integer_sequence/unpack.cpp @@ -0,0 +1,47 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include + +#include + +#include +#include +namespace hana = boost::hana; + + +int main() { + hana::test::_injection<0> f{}; + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::unpack(std::integer_sequence{}, f), + f() + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::unpack(std::integer_sequence{}, f), + f(std::integral_constant{}) + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::unpack(std::integer_sequence{}, f), + f(std::integral_constant{}, std::integral_constant{}) + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::unpack(std::integer_sequence{}, f), + f(std::integral_constant{}, std::integral_constant{}, + std::integral_constant{}) + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::unpack(std::integer_sequence{}, f), + f(std::integral_constant{}, std::integral_constant{}, + std::integral_constant{}, std::integral_constant{}) + )); +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/arithmetic.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/arithmetic.cpp new file mode 100644 index 000000000..25372ddd5 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/arithmetic.cpp @@ -0,0 +1,31 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + auto ints = hana::make_tuple( + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{} + ); + + hana::test::TestMonoid>{ints}; + hana::test::TestGroup>{ints}; + hana::test::TestRing>{ints}; + hana::test::TestEuclideanRing>{ints}; +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/comparable.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/comparable.cpp new file mode 100644 index 000000000..d17b6d810 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/comparable.cpp @@ -0,0 +1,27 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + auto ints = hana::make_tuple( + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{} + ); + + hana::test::TestComparable>{ints}; + hana::test::TestHashable>{ints}; +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/constant.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/constant.cpp new file mode 100644 index 000000000..f15fb8e80 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/constant.cpp @@ -0,0 +1,33 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include +#include + +#include + +#include +namespace hana = boost::hana; + + +int main() { + // value + static_assert(hana::value(std::integral_constant{}) == 0, ""); + static_assert(hana::value(std::integral_constant{}) == 1, ""); + static_assert(hana::value(std::integral_constant{}) == 3, ""); + + // laws + hana::test::TestConstant>{ + hana::make_tuple( + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{} + ), + hana::tuple_t + }; +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/interop.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/interop.cpp new file mode 100644 index 000000000..9b445f01b --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/interop.cpp @@ -0,0 +1,22 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + // Interoperation with hana::integral_constant + BOOST_HANA_CONSTANT_CHECK(std::integral_constant{} == hana::int_c<1>); + BOOST_HANA_CONSTANT_CHECK(std::integral_constant{} == hana::long_c<1>); + + BOOST_HANA_CONSTANT_CHECK(std::integral_constant{} != hana::int_c<3>); +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/logical.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/logical.cpp new file mode 100644 index 000000000..38d8091c2 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/logical.cpp @@ -0,0 +1,63 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + // eval_if + { + auto t = hana::test::ct_eq<3>{}; + auto e = hana::test::ct_eq<4>{}; + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::eval_if(std::true_type{}, hana::always(t), hana::always(e)), + t + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::eval_if(std::false_type{}, hana::always(t), hana::always(e)), + e + )); + } + + // not_ + { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::not_(std::true_type{}), + std::false_type{} + )); + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::not_(std::false_type{}), + std::true_type{} + )); + } + + auto ints = hana::make_tuple( + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{} + ); + + auto bools = hana::make_tuple(std::true_type{}, std::false_type{}); + + // laws + hana::test::TestLogical>{ints}; + hana::test::TestLogical>{bools}; +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/orderable.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/orderable.cpp new file mode 100644 index 000000000..6a14ad147 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/orderable.cpp @@ -0,0 +1,25 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include + +#include +namespace hana = boost::hana; + + +int main() { + auto ints = hana::make_tuple( + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{}, + std::integral_constant{} + ); + + hana::test::TestOrderable>{ints}; +} diff --git a/src/boost/libs/hana/test/ext/std/integral_constant/tag.cpp b/src/boost/libs/hana/test/ext/std/integral_constant/tag.cpp new file mode 100644 index 000000000..8a747e441 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/integral_constant/tag.cpp @@ -0,0 +1,53 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include + +#include +namespace hana = boost::hana; + + +struct inherit_simple : std::integral_constant { }; +struct inherit_no_default : std::integral_constant { + inherit_no_default() = delete; +}; + +struct incomplete; +struct empty_type { }; +struct non_pod { virtual ~non_pod() { } }; + + +static_assert(std::is_same< + hana::tag_of_t, + hana::ext::std::integral_constant_tag +>{}, ""); +static_assert(std::is_same< + hana::tag_of_t, + hana::ext::std::integral_constant_tag +>{}, ""); +static_assert(std::is_same< + hana::tag_of_t>, + hana::ext::std::integral_constant_tag +>{}, ""); + +static_assert(!std::is_same< + hana::tag_of_t, + hana::ext::std::integral_constant_tag +>{}, ""); +static_assert(!std::is_same< + hana::tag_of_t, + hana::ext::std::integral_constant_tag +>{}, ""); +static_assert(!std::is_same< + hana::tag_of_t, + hana::ext::std::integral_constant_tag +>{}, ""); +static_assert(!std::is_same< + hana::tag_of_t, + hana::ext::std::integral_constant_tag +>{}, ""); + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/pair/first_second.cpp b/src/boost/libs/hana/test/ext/std/pair/first_second.cpp new file mode 100644 index 000000000..a44ed1cc3 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/pair/first_second.cpp @@ -0,0 +1,30 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include + +#include + +#include +namespace hana = boost::hana; +using hana::test::ct_eq; + + +int main() { + // first + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::first(std::make_pair(ct_eq<0>{}, ct_eq<1>{})), + ct_eq<0>{} + )); + + // second + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::second(std::make_pair(ct_eq<0>{}, ct_eq<1>{})), + ct_eq<1>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/pair/issue_90.cpp b/src/boost/libs/hana/test/ext/std/pair/issue_90.cpp new file mode 100644 index 000000000..d8f70c56e --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/pair/issue_90.cpp @@ -0,0 +1,44 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include + +#include +namespace hana = boost::hana; + + +template +T const& cref(T& t) { return t; } + +// a non-movable, non-copyable type +template +struct RefOnly { + RefOnly() = default; + RefOnly(RefOnly const&) = delete; + RefOnly(RefOnly&&) = delete; +}; + +int main() { + // This test makes sure that we return the proper reference types from + // `first` and `second`. + std::pair, RefOnly<1>> p; + + { + RefOnly<0>&& r1 = hana::first(std::move(p)); + RefOnly<0>& r2 = hana::first(p); + RefOnly<0> const& r3 = hana::first(cref(p)); + + (void)r1; (void)r2; (void)r3; + } + + { + RefOnly<1>&& r1 = hana::second(std::move(p)); + RefOnly<1>& r2 = hana::second(p); + RefOnly<1> const& r3 = hana::second(cref(p)); + + (void)r1; (void)r2; (void)r3; + } +} diff --git a/src/boost/libs/hana/test/ext/std/pair/laws.cpp b/src/boost/libs/hana/test/ext/std/pair/laws.cpp new file mode 100644 index 000000000..869001ab6 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/pair/laws.cpp @@ -0,0 +1,41 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include + +#include +#include +#include +#include +#include + +#include +namespace hana = boost::hana; +using hana::test::ct_eq; +using hana::test::ct_ord; + + +int main() { + auto eq_elems = hana::make_tuple(ct_eq<3>{}, ct_eq<4>{}); + + auto eqs = hana::make_tuple( + std::make_pair(ct_eq<3>{}, ct_eq<3>{}) + , std::make_pair(ct_eq<3>{}, ct_eq<4>{}) + , std::make_pair(ct_eq<4>{}, ct_eq<3>{}) + , std::make_pair(ct_eq<4>{}, ct_eq<4>{}) + ); + + auto ords = hana::make_tuple( + std::make_pair(ct_ord<3>{}, ct_ord<3>{}) + , std::make_pair(ct_ord<3>{}, ct_ord<4>{}) + , std::make_pair(ct_ord<4>{}, ct_ord<3>{}) + , std::make_pair(ct_ord<4>{}, ct_ord<4>{}) + ); + + hana::test::TestComparable{eqs}; + hana::test::TestOrderable{ords}; + hana::test::TestFoldable{eqs}; + hana::test::TestProduct{eq_elems}; +} diff --git a/src/boost/libs/hana/test/ext/std/pair/make.cpp b/src/boost/libs/hana/test/ext/std/pair/make.cpp new file mode 100644 index 000000000..f0cb9d297 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/pair/make.cpp @@ -0,0 +1,26 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include + +#include + +#include +namespace hana = boost::hana; +using hana::test::ct_eq; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::make(ct_eq<0>{}, ct_eq<1>{}), + std::make_pair(ct_eq<0>{}, ct_eq<1>{}) + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::make(ct_eq<3>{}, ct_eq<4>{}), + std::make_pair(ct_eq<3>{}, ct_eq<4>{}) + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/div.cpp b/src/boost/libs/hana/test/ext/std/ratio/div.cpp new file mode 100644 index 000000000..327717fcb --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/div.cpp @@ -0,0 +1,24 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::div(std::ratio<6>{}, std::ratio<4>{}), + std::ratio<6, 4>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::div(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*10, 4*5>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/equal.cpp b/src/boost/libs/hana/test/ext/std/ratio/equal.cpp new file mode 100644 index 000000000..f72ec8980 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/equal.cpp @@ -0,0 +1,34 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + std::ratio<0>{}, + std::ratio<0>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + std::ratio<3>{}, + std::ratio<3>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + std::ratio<3, 5>{}, + std::ratio<6, 10>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal( + std::ratio<4, 5>{}, + std::ratio<6, 10>{} + ))); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/laws.cpp b/src/boost/libs/hana/test/ext/std/ratio/laws.cpp new file mode 100644 index 000000000..460fe3c81 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/laws.cpp @@ -0,0 +1,37 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include + +#include +#include +#include +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + auto ratios = hana::make_tuple( + std::ratio<0>{} + , std::ratio<1, 3>{} + , std::ratio<1, 2>{} + , std::ratio<2, 6>{} + , std::ratio<3, 1>{} + , std::ratio<7, 8>{} + , std::ratio<3, 5>{} + , std::ratio<2, 1>{} + ); + + hana::test::TestComparable{ratios}; + hana::test::TestOrderable{ratios}; + hana::test::TestMonoid{ratios}; + hana::test::TestGroup{ratios}; + hana::test::TestRing{ratios}; + hana::test::TestEuclideanRing{ratios}; +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/less.cpp b/src/boost/libs/hana/test/ext/std/ratio/less.cpp new file mode 100644 index 000000000..79e8dbc42 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/less.cpp @@ -0,0 +1,29 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::less( + std::ratio<1>{}, + std::ratio<3>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::less( + std::ratio<4, 10>{}, + std::ratio<3, 5>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less( + std::ratio<3, 5>{}, + std::ratio<4, 10>{} + ))); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/minus.cpp b/src/boost/libs/hana/test/ext/std/ratio/minus.cpp new file mode 100644 index 000000000..9a6bc4199 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/minus.cpp @@ -0,0 +1,19 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::minus(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*10 - 5*4, 4*10>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/mod.cpp b/src/boost/libs/hana/test/ext/std/ratio/mod.cpp new file mode 100644 index 000000000..24c748eb3 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/mod.cpp @@ -0,0 +1,24 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::mod(std::ratio<6>{}, std::ratio<4>{}), + std::ratio<0>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::mod(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<0>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/mult.cpp b/src/boost/libs/hana/test/ext/std/ratio/mult.cpp new file mode 100644 index 000000000..5f345bf2f --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/mult.cpp @@ -0,0 +1,19 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::mult(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*5, 4*10>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/one.cpp b/src/boost/libs/hana/test/ext/std/ratio/one.cpp new file mode 100644 index 000000000..a05ac1be1 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/one.cpp @@ -0,0 +1,24 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::one(), + std::ratio<1, 1>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::one(), + std::ratio<2, 2>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/plus.cpp b/src/boost/libs/hana/test/ext/std/ratio/plus.cpp new file mode 100644 index 000000000..33a47bd9d --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/plus.cpp @@ -0,0 +1,19 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::plus(std::ratio<3, 4>{}, std::ratio<5, 10>{}), + std::ratio<3*10 + 5*4, 4*10>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/to.cpp b/src/boost/libs/hana/test/ext/std/ratio/to.cpp new file mode 100644 index 000000000..2795c990a --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/to.cpp @@ -0,0 +1,36 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +#include + +#include +#include +namespace hana = boost::hana; + + +int main() { + // Conversion from a Constant to a std::ratio + { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::to(cnumeric), + std::ratio<0>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::to(cnumeric), + std::ratio<1>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::to(cnumeric), + std::ratio<3>{} + )); + } +} diff --git a/src/boost/libs/hana/test/ext/std/ratio/zero.cpp b/src/boost/libs/hana/test/ext/std/ratio/zero.cpp new file mode 100644 index 000000000..af0fa1711 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/ratio/zero.cpp @@ -0,0 +1,24 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include + +#include +namespace hana = boost::hana; + + +int main() { + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::zero(), + std::ratio<0, 1>{} + )); + + BOOST_HANA_CONSTANT_CHECK(hana::equal( + hana::zero(), + std::ratio<0, 2>{} + )); +} diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/_specs.hpp b/src/boost/libs/hana/test/ext/std/tuple/auto/_specs.hpp new file mode 100644 index 000000000..c165d4214 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/_specs.hpp @@ -0,0 +1,17 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_HANA_TEST_EXT_STD_TUPLE_AUTO_SPECS_HPP +#define BOOST_HANA_TEST_EXT_STD_TUPLE_AUTO_SPECS_HPP + +#include + +#include + + +#define MAKE_TUPLE(...) ::std::make_tuple(__VA_ARGS__) +#define TUPLE_TYPE(...) ::std::tuple<__VA_ARGS__> +#define TUPLE_TAG ::boost::hana::ext::std::tuple_tag + +#endif // !BOOST_HANA_TEST_EXT_STD_TUPLE_AUTO_SPECS_HPP diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/all_of.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/all_of.cpp new file mode 100644 index 000000000..f3e974ffd --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/all_of.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/any_of.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/any_of.cpp new file mode 100644 index 000000000..3065d0175 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/any_of.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/ap.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/ap.cpp new file mode 100644 index 000000000..59c9cb757 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/ap.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/at.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/at.cpp new file mode 100644 index 000000000..605265331 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/at.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/cartesian_product.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/cartesian_product.cpp new file mode 100644 index 000000000..b0795e8d7 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/cartesian_product.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/drop_back.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/drop_back.cpp new file mode 100644 index 000000000..b283844d6 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/drop_back.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/drop_front.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/drop_front.cpp new file mode 100644 index 000000000..a39d6f450 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/drop_front.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/drop_while.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/drop_while.cpp new file mode 100644 index 000000000..18907f033 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/drop_while.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/for_each.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/for_each.cpp new file mode 100644 index 000000000..714fe03c0 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/for_each.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/group.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/group.cpp new file mode 100644 index 000000000..0669b496f --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/group.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/index_if.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/index_if.cpp new file mode 100644 index 000000000..ef37fe65a --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/index_if.cpp @@ -0,0 +1,9 @@ +// Copyright Louis Dionne 2013-2017 +// Copyright Jason Rice 2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/insert.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/insert.cpp new file mode 100644 index 000000000..e8efc6dc1 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/insert.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/insert_range.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/insert_range.cpp new file mode 100644 index 000000000..05ac5774e --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/insert_range.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/intersperse.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/intersperse.cpp new file mode 100644 index 000000000..185c814a9 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/intersperse.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/is_empty.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/is_empty.cpp new file mode 100644 index 000000000..f175f7ddb --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/is_empty.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/length.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/length.cpp new file mode 100644 index 000000000..55111dd60 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/length.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/lexicographical_compare.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/lexicographical_compare.cpp new file mode 100644 index 000000000..4d2f3edf4 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/lexicographical_compare.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/make.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/make.cpp new file mode 100644 index 000000000..f90514f16 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/make.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/none_of.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/none_of.cpp new file mode 100644 index 000000000..b56a27b47 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/none_of.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/partition.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/partition.cpp new file mode 100644 index 000000000..ba9621a6c --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/partition.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/permutations.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/permutations.cpp new file mode 100644 index 000000000..3c1a6e852 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/permutations.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/remove_at.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/remove_at.cpp new file mode 100644 index 000000000..5b7c5af47 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/remove_at.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/remove_range.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/remove_range.cpp new file mode 100644 index 000000000..6d7c6e090 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/remove_range.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/reverse.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/reverse.cpp new file mode 100644 index 000000000..342278df8 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/reverse.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/scans.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/scans.cpp new file mode 100644 index 000000000..36dd32437 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/scans.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/sequence.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/sequence.cpp new file mode 100644 index 000000000..4ed01e852 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/sequence.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/slice.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/slice.cpp new file mode 100644 index 000000000..3e20df95f --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/slice.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/sort.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/sort.cpp new file mode 100644 index 000000000..f639ddeb0 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/sort.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/span.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/span.cpp new file mode 100644 index 000000000..297b7f174 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/span.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/take_back.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/take_back.cpp new file mode 100644 index 000000000..2a91d7d4d --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/take_back.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/take_front.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/take_front.cpp new file mode 100644 index 000000000..9a48d2b8c --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/take_front.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/take_while.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/take_while.cpp new file mode 100644 index 000000000..e58c99aca --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/take_while.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/transform.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/transform.cpp new file mode 100644 index 000000000..306c1bc3c --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/transform.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/unfolds.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/unfolds.cpp new file mode 100644 index 000000000..f8bac9ddc --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/unfolds.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/unique.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/unique.cpp new file mode 100644 index 000000000..9c1dc7155 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/unique.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/auto/zips.cpp b/src/boost/libs/hana/test/ext/std/tuple/auto/zips.cpp new file mode 100644 index 000000000..32ec5cc8a --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/auto/zips.cpp @@ -0,0 +1,8 @@ +// Copyright Louis Dionne 2013-2017 +// 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 "_specs.hpp" +#include + +int main() { } diff --git a/src/boost/libs/hana/test/ext/std/tuple/issue_90.cpp b/src/boost/libs/hana/test/ext/std/tuple/issue_90.cpp new file mode 100644 index 000000000..dfbb4a7fc --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/issue_90.cpp @@ -0,0 +1,73 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include +#include + +#include +#include +namespace hana = boost::hana; + + +template +T const& cref(T& t) { return t; } + +// a non-movable, non-copyable type +struct RefOnly { + RefOnly() = default; + RefOnly(RefOnly const&) = delete; + RefOnly(RefOnly&&) = delete; +}; + +template +struct RefOnly_i : hana::int_ { + RefOnly_i() = default; + RefOnly_i(RefOnly_i const&) = delete; + RefOnly_i(RefOnly_i&&) = delete; +}; + +int main() { + std::tuple t; + + // Make sure that we return the proper reference types from `at`. + { + RefOnly&& r1 = hana::at_c<0>(std::move(t)); + RefOnly& r2 = hana::at_c<0>(t); + RefOnly const& r3 = hana::at_c<0>(cref(t)); + + (void)r1; (void)r2; (void)r3; + } + + // Make sure we return the proper reference types from `front`. + { + RefOnly&& r1 = hana::front(std::move(t)); + RefOnly& r2 = hana::front(t); + RefOnly const& r3 = hana::front(cref(t)); + + (void)r1; (void)r2; (void)r3; + } + + // Make sure we return the proper reference types from `back`. + { + RefOnly&& r1 = hana::back(std::move(t)); + RefOnly& r2 = hana::back(t); + RefOnly const& r3 = hana::back(cref(t)); + + (void)r1; (void)r2; (void)r3; + } + + // Make sure we return the proper reference types from `at_key`. + { + std::tuple> t{}; + RefOnly_i<3>& r1 = hana::at_key(t, RefOnly_i<3>{}); + RefOnly_i<3> const& r2 = hana::at_key(cref(t), RefOnly_i<3>{}); + RefOnly_i<3>&& r3 = hana::at_key(std::move(t), RefOnly_i<3>{}); + + (void)r1; (void)r2; (void)r3; + } +} diff --git a/src/boost/libs/hana/test/ext/std/tuple/laws.cpp b/src/boost/libs/hana/test/ext/std/tuple/laws.cpp new file mode 100644 index 000000000..4c56bc8ee --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/laws.cpp @@ -0,0 +1,43 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include + +#include +#include +#include +#include +#include +#include + +#include +namespace hana = boost::hana; +using hana::test::ct_eq; +using hana::test::ct_ord; + + +int main() { + auto eq_tuples = hana::make_tuple( + std::make_tuple() + , std::make_tuple(ct_eq<0>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}, ct_eq<3>{}, ct_eq<4>{}) + ); + + auto ord_tuples = hana::make_tuple( + std::make_tuple() + , std::make_tuple(ct_ord<0>{}) + , std::make_tuple(ct_ord<0>{}, ct_ord<1>{}) + , std::make_tuple(ct_ord<0>{}, ct_ord<1>{}, ct_ord<2>{}) + , std::make_tuple(ct_ord<0>{}, ct_ord<1>{}, ct_ord<2>{}, ct_ord<3>{}, ct_ord<4>{}) + ); + + hana::test::TestComparable{eq_tuples}; + hana::test::TestOrderable{ord_tuples}; + hana::test::TestFoldable{eq_tuples}; + hana::test::TestIterable{eq_tuples}; + hana::test::TestSequence{}; +} diff --git a/src/boost/libs/hana/test/ext/std/tuple/laws.functor.cpp b/src/boost/libs/hana/test/ext/std/tuple/laws.functor.cpp new file mode 100644 index 000000000..874d01f9b --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/laws.functor.cpp @@ -0,0 +1,55 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +namespace hana = boost::hana; +using hana::test::ct_eq; + + +int main() { + auto tuples = hana::make_tuple( + std::make_tuple() + , std::make_tuple(ct_eq<0>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}, ct_eq<3>{}, ct_eq<4>{}) + ); + + auto values = hana::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}); + + auto nested_tuples = hana::make_tuple( + std::make_tuple() + , std::make_tuple( + std::make_tuple(ct_eq<0>{})) + , std::make_tuple( + std::make_tuple(ct_eq<0>{}), + std::make_tuple(ct_eq<1>{}, ct_eq<2>{})) + , std::make_tuple( + std::make_tuple(ct_eq<0>{}), + std::make_tuple(ct_eq<1>{}, ct_eq<2>{}), + std::make_tuple(ct_eq<3>{}, ct_eq<4>{})) + ); + + auto predicates = hana::make_tuple( + hana::equal.to(ct_eq<0>{}), hana::equal.to(ct_eq<1>{}), hana::equal.to(ct_eq<2>{}), + hana::always(hana::false_c), hana::always(hana::true_c) + ); + + hana::test::TestFunctor{tuples, values}; + hana::test::TestApplicative{tuples}; + hana::test::TestMonad{tuples, nested_tuples}; + hana::test::TestMonadPlus{tuples, predicates, values}; +} diff --git a/src/boost/libs/hana/test/ext/std/tuple/laws.searchable.cpp b/src/boost/libs/hana/test/ext/std/tuple/laws.searchable.cpp new file mode 100644 index 000000000..7eb6b42b9 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/tuple/laws.searchable.cpp @@ -0,0 +1,38 @@ +// Copyright Louis Dionne 2013-2017 +// 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 +#include +#include + +#include +#include + +#include +namespace hana = boost::hana; +using hana::test::ct_eq; + + +int main() { + auto tuples = hana::make_tuple( + std::make_tuple() + , std::make_tuple(ct_eq<0>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}) + , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}) + ); + auto keys = hana::make_tuple(ct_eq<3>{}, ct_eq<5>{}, ct_eq<7>{}); + + auto bool_tuples = hana::make_tuple( + std::make_tuple(hana::true_c) + , std::make_tuple(hana::false_c) + , std::make_tuple(hana::true_c, hana::true_c) + , std::make_tuple(hana::true_c, hana::false_c) + , std::make_tuple(hana::false_c, hana::true_c) + , std::make_tuple(hana::false_c, hana::false_c) + ); + auto bool_keys = hana::make_tuple(hana::true_c, hana::false_c); + + hana::test::TestSearchable{tuples, keys}; + hana::test::TestSearchable{bool_tuples, bool_keys}; +} diff --git a/src/boost/libs/hana/test/ext/std/vector.cpp b/src/boost/libs/hana/test/ext/std/vector.cpp new file mode 100644 index 000000000..1e9e7cde1 --- /dev/null +++ b/src/boost/libs/hana/test/ext/std/vector.cpp @@ -0,0 +1,44 @@ +// Copyright Louis Dionne 2013-2017 +// 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 + +#include +#include + +#include +#include +// #include +#include + +#include +namespace hana = boost::hana; + + +int main() { + auto eqs = hana::make_tuple( + std::vector>{0} + , std::vector>{1} + , std::vector>{2} + , std::vector>{3} + , std::vector>{4} + ); + + // auto eq_values = hana::make_tuple(hana::test::eq<0>{}, hana::test::eq<2>{}); + + auto ords = hana::make_tuple( + std::vector>{0} + , std::vector>{1} + , std::vector>{2} + , std::vector>{3} + , std::vector>{4} + ); + + ////////////////////////////////////////////////////////////////////////// + // Comparable, Orderable, Functor + ////////////////////////////////////////////////////////////////////////// + hana::test::TestComparable{eqs}; + hana::test::TestOrderable{ords}; + // hana::test::TestFunctor{eqs, eq_values}; +} -- cgit v1.2.3