Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #193
- Loading branch information
Showing
26 changed files
with
1,964 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
@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/experimental/view.hpp> | ||
#include <boost/hana/is_empty.hpp> | ||
namespace hana = boost::hana; | ||
|
||
|
||
int main() { | ||
{ | ||
auto empty = hana::experimental::empty_view(); | ||
BOOST_HANA_CONSTANT_CHECK(hana::is_empty(empty)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
@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/experimental/view.hpp> | ||
#include <boost/hana/integral_constant.hpp> | ||
#include <boost/hana/length.hpp> | ||
namespace hana = boost::hana; | ||
|
||
|
||
int main() { | ||
{ | ||
auto empty = hana::experimental::empty_view(); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(empty), | ||
hana::size_c<0> | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
@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/experimental/view.hpp> | ||
#include <boost/hana/unpack.hpp> | ||
|
||
#include <laws/base.hpp> | ||
namespace hana = boost::hana; | ||
|
||
|
||
int main() { | ||
auto f = hana::test::_injection<0>{}; | ||
|
||
{ | ||
auto empty = hana::experimental::empty_view(); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(empty, f), | ||
f() | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
@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/at.hpp> | ||
#include <boost/hana/equal.hpp> | ||
#include <boost/hana/experimental/view.hpp> | ||
#include <boost/hana/integral_constant.hpp> | ||
|
||
#include <laws/base.hpp> | ||
#include <test/seq.hpp> | ||
namespace hana = boost::hana; | ||
using hana::test::ct_eq; | ||
|
||
|
||
int main() { | ||
auto container = hana::test::seq; | ||
|
||
{ | ||
auto storage1 = container(ct_eq<0>{}); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<0>), | ||
ct_eq<0>{} | ||
)); | ||
}{ | ||
auto storage1 = container(); | ||
auto storage2 = container(ct_eq<0>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<0>), | ||
ct_eq<0>{} | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(ct_eq<0>{}, ct_eq<1>{}); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<0>), | ||
ct_eq<0>{} | ||
)); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<1>), | ||
ct_eq<1>{} | ||
)); | ||
}{ | ||
auto storage1 = container(ct_eq<0>{}); | ||
auto storage2 = container(ct_eq<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<0>), | ||
ct_eq<0>{} | ||
)); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<1>), | ||
ct_eq<1>{} | ||
)); | ||
}{ | ||
auto storage1 = container(); | ||
auto storage2 = container(ct_eq<0>{}, ct_eq<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<0>), | ||
ct_eq<0>{} | ||
)); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<1>), | ||
ct_eq<1>{} | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(ct_eq<0>{}, ct_eq<1>{}); | ||
auto storage2 = container(ct_eq<2>{}, ct_eq<3>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<0>), | ||
ct_eq<0>{} | ||
)); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<1>), | ||
ct_eq<1>{} | ||
)); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<2>), | ||
ct_eq<2>{} | ||
)); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::at(joined, hana::size_c<3>), | ||
ct_eq<3>{} | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
@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/experimental/view.hpp> | ||
#include <boost/hana/is_empty.hpp> | ||
#include <boost/hana/not.hpp> | ||
|
||
#include <test/seq.hpp> | ||
namespace hana = boost::hana; | ||
|
||
|
||
template <int> struct undefined { }; | ||
|
||
int main() { | ||
auto container = hana::test::seq; | ||
|
||
{ | ||
auto storage1 = container(); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::is_empty(joined)); | ||
} | ||
{ | ||
auto storage1 = container(undefined<0>{}); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(joined))); | ||
} | ||
{ | ||
auto storage1 = container(undefined<0>{}); | ||
auto storage2 = container(undefined<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(joined))); | ||
} | ||
{ | ||
auto storage1 = container(); | ||
auto storage2 = container(undefined<0>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(joined))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
@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/experimental/view.hpp> | ||
#include <boost/hana/integral_constant.hpp> | ||
#include <boost/hana/length.hpp> | ||
|
||
#include <test/seq.hpp> | ||
namespace hana = boost::hana; | ||
|
||
|
||
template <int> struct undefined { }; | ||
|
||
int main() { | ||
auto container = hana::test::seq; | ||
|
||
{ | ||
auto storage1 = container(); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<0> | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(undefined<0>{}); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<1> | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(); | ||
auto storage2 = container(undefined<0>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<1> | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(undefined<0>{}); | ||
auto storage2 = container(undefined<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<2> | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(undefined<0>{}); | ||
auto storage2 = container(undefined<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<2> | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(undefined<0>{}, undefined<1>{}); | ||
auto storage2 = container(undefined<2>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<3> | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(undefined<0>{}, undefined<1>{}, undefined<2>{}); | ||
auto storage2 = container(undefined<3>{}, undefined<4>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::length(joined), | ||
hana::size_c<5> | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
@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/experimental/view.hpp> | ||
#include <boost/hana/unpack.hpp> | ||
|
||
#include <laws/base.hpp> | ||
#include <test/seq.hpp> | ||
namespace hana = boost::hana; | ||
using hana::test::ct_eq; | ||
|
||
|
||
int main() { | ||
auto container = hana::test::seq; | ||
auto f = hana::test::_injection<0>{}; | ||
|
||
{ | ||
auto storage1 = container(); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f() | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(ct_eq<0>{}); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f(ct_eq<0>{}) | ||
)); | ||
}{ | ||
auto storage1 = container(); | ||
auto storage2 = container(ct_eq<0>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f(ct_eq<0>{}) | ||
)); | ||
}{ | ||
auto storage1 = container(ct_eq<0>{}); | ||
auto storage2 = container(ct_eq<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f(ct_eq<0>{}, ct_eq<1>{}) | ||
)); | ||
} | ||
|
||
{ | ||
auto storage1 = container(ct_eq<0>{}, ct_eq<1>{}); | ||
auto storage2 = container(); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f(ct_eq<0>{}, ct_eq<1>{}) | ||
)); | ||
}{ | ||
auto storage1 = container(); | ||
auto storage2 = container(ct_eq<0>{}, ct_eq<1>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f(ct_eq<0>{}, ct_eq<1>{}) | ||
)); | ||
}{ | ||
auto storage1 = container(ct_eq<0>{}, ct_eq<1>{}); | ||
auto storage2 = container(ct_eq<2>{}, ct_eq<3>{}); | ||
auto joined = hana::experimental::joined(storage1, storage2); | ||
BOOST_HANA_CONSTANT_CHECK(hana::equal( | ||
hana::unpack(joined, f), | ||
f(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}, ct_eq<3>{}) | ||
)); | ||
} | ||
} |
Oops, something went wrong.