diff --git a/benchmark/foldable/CMakeLists.txt b/benchmark/foldable/CMakeLists.txt index c333d94e8..b8012efa5 100644 --- a/benchmark/foldable/CMakeLists.txt +++ b/benchmark/foldable/CMakeLists.txt @@ -14,7 +14,7 @@ foreach(method IN ITEMS count foldl foldl1 foldr foldr1 for_each length maximum { setup: ' #include - #include + #include ', foldable: \"boost::hana::tuple(#{xs})\", input_size: n @@ -30,7 +30,7 @@ foreach(method IN ITEMS count foldl foldl1 foldr foldr1 for_each length maximum { setup: ' - #include + #include #include #include ', @@ -44,7 +44,7 @@ foreach(method IN ITEMS count foldl foldl1 foldr foldr1 for_each length maximum ((1..50).to_a + (51..500).step(25).to_a).map { |n| xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { - setup: '#include ', + setup: '#include ', foldable: \"boost::hana::tuple(#{xs})\", input_size: n } @@ -56,7 +56,7 @@ foreach(method IN ITEMS count foldl foldl1 foldr foldr1 for_each length maximum xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { setup: ' - #include + #include #include ', foldable: \"std::make_tuple(#{xs})\", @@ -71,7 +71,7 @@ foreach(method IN ITEMS count foldl foldl1 foldr foldr1 for_each length maximum FEATURES COMPILATION_TIME EXECUTION_TIME MEMORY_USAGE ENV "((1..50).to_a + (51..500).step(25).to_a).map { |n| { - setup: '#include ', + setup: '#include ', foldable: \"boost::hana::range_c\", input_size: n } diff --git a/benchmark/foldable/count.cpp b/benchmark/foldable/count.cpp index f694df333..c92f22ba5 100644 --- a/benchmark/foldable/count.cpp +++ b/benchmark/foldable/count.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/foldl.cpp b/benchmark/foldable/foldl.cpp index 669f2a069..016c711c1 100644 --- a/benchmark/foldable/foldl.cpp +++ b/benchmark/foldable/foldl.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/foldable/foldl1.cpp b/benchmark/foldable/foldl1.cpp index 9e2ba1e0d..98ba69e93 100644 --- a/benchmark/foldable/foldl1.cpp +++ b/benchmark/foldable/foldl1.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/foldable/foldr.cpp b/benchmark/foldable/foldr.cpp index e5227eb53..404d33748 100644 --- a/benchmark/foldable/foldr.cpp +++ b/benchmark/foldable/foldr.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/foldable/foldr1.cpp b/benchmark/foldable/foldr1.cpp index f6f8a1e5a..5d5565697 100644 --- a/benchmark/foldable/foldr1.cpp +++ b/benchmark/foldable/foldr1.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/foldable/for_each.cpp b/benchmark/foldable/for_each.cpp index 25faee980..d79810ff7 100644 --- a/benchmark/foldable/for_each.cpp +++ b/benchmark/foldable/for_each.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/length.cpp b/benchmark/foldable/length.cpp index 449f12102..49e648765 100644 --- a/benchmark/foldable/length.cpp +++ b/benchmark/foldable/length.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/maximum.cpp b/benchmark/foldable/maximum.cpp index deb6bfe08..48a9c4941 100644 --- a/benchmark/foldable/maximum.cpp +++ b/benchmark/foldable/maximum.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/maximum_by.cpp b/benchmark/foldable/maximum_by.cpp index 7007a6ba5..af1a19e49 100644 --- a/benchmark/foldable/maximum_by.cpp +++ b/benchmark/foldable/maximum_by.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/minimum.cpp b/benchmark/foldable/minimum.cpp index 797d03300..f7dc630af 100644 --- a/benchmark/foldable/minimum.cpp +++ b/benchmark/foldable/minimum.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/minimum_by.cpp b/benchmark/foldable/minimum_by.cpp index f09b74b95..39e5ac0db 100644 --- a/benchmark/foldable/minimum_by.cpp +++ b/benchmark/foldable/minimum_by.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/product.cpp b/benchmark/foldable/product.cpp index 1e663f739..31b9081ba 100644 --- a/benchmark/foldable/product.cpp +++ b/benchmark/foldable/product.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/sum.cpp b/benchmark/foldable/sum.cpp index 37cb14c4c..1b4d70837 100644 --- a/benchmark/foldable/sum.cpp +++ b/benchmark/foldable/sum.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/foldable/unpack.cpp b/benchmark/foldable/unpack.cpp index d9c345dc7..f021946e3 100644 --- a/benchmark/foldable/unpack.cpp +++ b/benchmark/foldable/unpack.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/functor/CMakeLists.txt b/benchmark/functor/CMakeLists.txt index 796be6c61..6152c4eee 100644 --- a/benchmark/functor/CMakeLists.txt +++ b/benchmark/functor/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(method IN ITEMS adjust fill fmap replace) \"boost::hana::benchmark::object<#{i}>{}\" }.join(', ') { - setup: '#include ', + setup: '#include ', functor: \"boost::hana::tuple(#{xs})\", input_size: n } @@ -28,7 +28,7 @@ foreach(method IN ITEMS adjust fill fmap replace) }.join(', ') { setup: ' - #include + #include #include ', functor: \"std::make_tuple(#{xs})\", diff --git a/benchmark/functor/adjust.cpp b/benchmark/functor/adjust.cpp index 58cac8c4e..4900d7365 100644 --- a/benchmark/functor/adjust.cpp +++ b/benchmark/functor/adjust.cpp @@ -4,9 +4,9 @@ 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 "benchmark.hpp" diff --git a/benchmark/functor/fill.cpp b/benchmark/functor/fill.cpp index b26af55cb..1cee471c6 100644 --- a/benchmark/functor/fill.cpp +++ b/benchmark/functor/fill.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/functor/fmap.cpp b/benchmark/functor/fmap.cpp index 0f39a0e3f..4b4105b62 100644 --- a/benchmark/functor/fmap.cpp +++ b/benchmark/functor/fmap.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/functor/replace.cpp b/benchmark/functor/replace.cpp index 561fedf9d..df3f7a2f5 100644 --- a/benchmark/functor/replace.cpp +++ b/benchmark/functor/replace.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/iterable/CMakeLists.txt b/benchmark/iterable/CMakeLists.txt index c48709459..523d4768d 100644 --- a/benchmark/iterable/CMakeLists.txt +++ b/benchmark/iterable/CMakeLists.txt @@ -9,7 +9,7 @@ foreach(method IN ITEMS at drop drop_until drop_while last) ENV "((1..50).to_a + (51..500).step(25).to_a).map { |n| xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { - setup: '#include ', + setup: '#include ', iterable: \"boost::hana::tuple(#{xs})\", input_size: n } @@ -23,7 +23,7 @@ foreach(method IN ITEMS at drop drop_until drop_while last) xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { setup: ' - #include + #include #include ', iterable: \"std::make_tuple(#{xs})\", @@ -37,7 +37,7 @@ foreach(method IN ITEMS at drop drop_until drop_while last) FILE "${method}.cpp" ENV "((1..50).to_a + (51..500).step(25).to_a).map { |n| { - setup: '#include ', + setup: '#include ', iterable: \"::boost::hana::range_c\", input_size: n } diff --git a/benchmark/iterable/at.cpp b/benchmark/iterable/at.cpp index 4311450c8..a055b73bd 100644 --- a/benchmark/iterable/at.cpp +++ b/benchmark/iterable/at.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/iterable/drop.cpp b/benchmark/iterable/drop.cpp index 6b74aadee..47f29b5f6 100644 --- a/benchmark/iterable/drop.cpp +++ b/benchmark/iterable/drop.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/iterable/drop_until.cpp b/benchmark/iterable/drop_until.cpp index 9dd39b402..8c00a9548 100644 --- a/benchmark/iterable/drop_until.cpp +++ b/benchmark/iterable/drop_until.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/iterable/drop_while.cpp b/benchmark/iterable/drop_while.cpp index 017a58e77..6c9e19414 100644 --- a/benchmark/iterable/drop_while.cpp +++ b/benchmark/iterable/drop_while.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/iterable/last.cpp b/benchmark/iterable/last.cpp index 90494a3ae..663653f6b 100644 --- a/benchmark/iterable/last.cpp +++ b/benchmark/iterable/last.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/CMakeLists.txt b/benchmark/list/CMakeLists.txt index db4180eb0..d57aefa4d 100644 --- a/benchmark/list/CMakeLists.txt +++ b/benchmark/list/CMakeLists.txt @@ -14,7 +14,7 @@ foreach(method IN ITEMS filter make permutations reverse scanl scanl1 scanr scan { setup: ' #include - #include + #include ', list: \"boost::hana::tuple(#{xs})\", input_size: n @@ -31,7 +31,7 @@ foreach(method IN ITEMS filter make permutations reverse scanl scanl1 scanr scan }.join(', ') { setup: ' - #include + #include #include #include ', @@ -46,7 +46,7 @@ foreach(method IN ITEMS filter make permutations reverse scanl scanl1 scanr scan set(hana_tuple_env "((1..50).to_a + (51..500).step(25).to_a).map { |n| { - setup: '#include ', + setup: '#include ', datatype: 'boost::hana::Tuple', input_size: n } @@ -59,10 +59,10 @@ foreach(method IN ITEMS filter make permutations reverse scanl scanl1 scanr scan "((1..50).to_a + (51..500).step(25).to_a).map { |n| { setup: ' - #include + #include #include ', - datatype: 'boost::hana::StdTuple', + datatype: 'boost::hana::ext::std::Tuple', input_size: n } } @@ -74,7 +74,7 @@ foreach(method IN ITEMS filter make permutations reverse scanl scanl1 scanr scan "((1..50).to_a + (51..500).step(25).to_a).map { |n| xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { - setup: '#include ', + setup: '#include ', list: \"boost::hana::tuple(#{xs})\", input_size: n } @@ -89,7 +89,7 @@ foreach(method IN ITEMS filter make permutations reverse scanl scanl1 scanr scan xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { setup: ' - #include + #include #include ', list: \"std::make_tuple(#{xs})\", diff --git a/benchmark/list/filter.cpp b/benchmark/list/filter.cpp index 9ab2f99a1..d9e896d10 100644 --- a/benchmark/list/filter.cpp +++ b/benchmark/list/filter.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/intersperse.cpp b/benchmark/list/intersperse.cpp index 49d4b72d2..a796db42e 100644 --- a/benchmark/list/intersperse.cpp +++ b/benchmark/list/intersperse.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/make.cpp b/benchmark/list/make.cpp index 33806c204..1d9d46722 100644 --- a/benchmark/list/make.cpp +++ b/benchmark/list/make.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/permutations.cpp b/benchmark/list/permutations.cpp index d4d530163..7eff3258d 100644 --- a/benchmark/list/permutations.cpp +++ b/benchmark/list/permutations.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/reverse.cpp b/benchmark/list/reverse.cpp index 24247e457..4fb94235f 100644 --- a/benchmark/list/reverse.cpp +++ b/benchmark/list/reverse.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/scanl.cpp b/benchmark/list/scanl.cpp index 1b5176325..0bc5d4007 100644 --- a/benchmark/list/scanl.cpp +++ b/benchmark/list/scanl.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/list/scanl1.cpp b/benchmark/list/scanl1.cpp index 325a05948..471bbec21 100644 --- a/benchmark/list/scanl1.cpp +++ b/benchmark/list/scanl1.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/list/scanr.cpp b/benchmark/list/scanr.cpp index 5411d5013..37087376d 100644 --- a/benchmark/list/scanr.cpp +++ b/benchmark/list/scanr.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/list/scanr1.cpp b/benchmark/list/scanr1.cpp index 34d213254..867fa25b1 100644 --- a/benchmark/list/scanr1.cpp +++ b/benchmark/list/scanr1.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/list/sort.cpp b/benchmark/list/sort.cpp index c26930268..feb3394fd 100644 --- a/benchmark/list/sort.cpp +++ b/benchmark/list/sort.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/take.cpp b/benchmark/list/take.cpp index e607adcb3..004134819 100644 --- a/benchmark/list/take.cpp +++ b/benchmark/list/take.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/list/take_until.cpp b/benchmark/list/take_until.cpp index d297b3c30..a86c3ce98 100644 --- a/benchmark/list/take_until.cpp +++ b/benchmark/list/take_until.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/take_while.cpp b/benchmark/list/take_while.cpp index 8c09a5e1d..bd3c5d6bf 100644 --- a/benchmark/list/take_while.cpp +++ b/benchmark/list/take_while.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/list/zip_with.cpp b/benchmark/list/zip_with.cpp index 49611989c..b2b79e0f9 100644 --- a/benchmark/list/zip_with.cpp +++ b/benchmark/list/zip_with.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include "benchmark.hpp" diff --git a/benchmark/searchable/CMakeLists.txt b/benchmark/searchable/CMakeLists.txt index 13d4544ff..87c11bd12 100644 --- a/benchmark/searchable/CMakeLists.txt +++ b/benchmark/searchable/CMakeLists.txt @@ -12,8 +12,8 @@ foreach(method IN ITEMS all any elem find lookup none subset) }.join(', ') { setup: ' - #include - #include + #include + #include ', searchable: \"boost::hana::tuple(#{xs})\", input_size: n @@ -28,8 +28,8 @@ foreach(method IN ITEMS all any elem find lookup none subset) }.join(', ') { setup: ' - #include - #include + #include + #include #include ', searchable: \"std::make_tuple(#{xs})\", @@ -42,7 +42,7 @@ foreach(method IN ITEMS all any elem find lookup none subset) "((1..50).to_a + (51..500).step(25).to_a).map { |n| xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { - setup: '#include ', + setup: '#include ', searchable: \"boost::hana::tuple(#{xs})\", input_size: n } @@ -54,7 +54,7 @@ foreach(method IN ITEMS all any elem find lookup none subset) xs = (1..n).to_a.map { |i| \"x<#{i}>{}\" }.join(', ') { setup: ' - #include + #include #include ', searchable: \"std::make_tuple(#{xs})\", diff --git a/benchmark/searchable/all.cpp b/benchmark/searchable/all.cpp index 8866ac07c..76be50a77 100644 --- a/benchmark/searchable/all.cpp +++ b/benchmark/searchable/all.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/searchable/any.cpp b/benchmark/searchable/any.cpp index edeadcb96..6df391990 100644 --- a/benchmark/searchable/any.cpp +++ b/benchmark/searchable/any.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/searchable/elem.cpp b/benchmark/searchable/elem.cpp index e8a96c04c..be9d39daf 100644 --- a/benchmark/searchable/elem.cpp +++ b/benchmark/searchable/elem.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/searchable/find.cpp b/benchmark/searchable/find.cpp index 04804c7aa..394891c87 100644 --- a/benchmark/searchable/find.cpp +++ b/benchmark/searchable/find.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/searchable/lookup.cpp b/benchmark/searchable/lookup.cpp index 8422fb4bb..d7ac1872b 100644 --- a/benchmark/searchable/lookup.cpp +++ b/benchmark/searchable/lookup.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/searchable/none.cpp b/benchmark/searchable/none.cpp index 66091af70..be72ab1e1 100644 --- a/benchmark/searchable/none.cpp +++ b/benchmark/searchable/none.cpp @@ -4,8 +4,8 @@ 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 "benchmark.hpp" diff --git a/benchmark/searchable/subset.cpp b/benchmark/searchable/subset.cpp index 426c43e6f..b26864d8b 100644 --- a/benchmark/searchable/subset.cpp +++ b/benchmark/searchable/subset.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" diff --git a/benchmark/vs/foldl/hana.cpp b/benchmark/vs/foldl/hana.cpp index e1b536db3..026ed8f51 100644 --- a/benchmark/vs/foldl/hana.cpp +++ b/benchmark/vs/foldl/hana.cpp @@ -4,7 +4,7 @@ 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 "benchmark.hpp" #include diff --git a/example/core/disable.cpp b/example/core/disable.cpp index 14d1abaeb..7e264c7a1 100644 --- a/example/core/disable.cpp +++ b/example/core/disable.cpp @@ -4,21 +4,22 @@ 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 using namespace boost::hana; namespace boost { namespace hana { template <> - struct Foldable::instance : disable { }; + struct Foldable::instance : disable { }; }} // Usually, List should provide Foldable. -BOOST_HANA_CONSTANT_ASSERT(is_a); -BOOST_HANA_CONSTANT_ASSERT(!is_a); +BOOST_HANA_CONSTANT_ASSERT(is_a); +BOOST_HANA_CONSTANT_ASSERT(!is_a); int main() { } diff --git a/example/core/is_a.cpp b/example/core/is_a.cpp index 9058daf41..a8d3de720 100644 --- a/example/core/is_a.cpp +++ b/example/core/is_a.cpp @@ -5,17 +5,17 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include +#include #include #include #include #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/example/core/operators.cpp b/example/core/operators.cpp index fdb79d2e4..25338c8c4 100644 --- a/example/core/operators.cpp +++ b/example/core/operators.cpp @@ -4,7 +4,7 @@ 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 diff --git a/example/cppcon_2014/matrix/comparable.hpp b/example/cppcon_2014/matrix/comparable.hpp index 5d0847265..882072d45 100644 --- a/example/cppcon_2014/matrix/comparable.hpp +++ b/example/cppcon_2014/matrix/comparable.hpp @@ -10,9 +10,9 @@ Distributed under the Boost Software License, Version 1.0. #include "matrix.hpp" #include -#include -#include -#include +#include +#include +#include namespace boost { namespace hana { diff --git a/example/cppcon_2014/matrix/det.hpp b/example/cppcon_2014/matrix/det.hpp index 66ca6e1a7..7c5509b2b 100644 --- a/example/cppcon_2014/matrix/det.hpp +++ b/example/cppcon_2014/matrix/det.hpp @@ -7,20 +7,20 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_DET_HPP #define BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_DET_HPP -#include -#include +#include +#include #include #include #include #include #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/example/cppcon_2014/matrix/functor.hpp b/example/cppcon_2014/matrix/functor.hpp index 764fb862f..6d64ea145 100644 --- a/example/cppcon_2014/matrix/functor.hpp +++ b/example/cppcon_2014/matrix/functor.hpp @@ -11,7 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include -#include +#include #include diff --git a/example/cppcon_2014/matrix/group.hpp b/example/cppcon_2014/matrix/group.hpp index 3226240ad..79a3abb3b 100644 --- a/example/cppcon_2014/matrix/group.hpp +++ b/example/cppcon_2014/matrix/group.hpp @@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0. #include "matrix.hpp" -#include +#include #include diff --git a/example/cppcon_2014/matrix/matrix.hpp b/example/cppcon_2014/matrix/matrix.hpp index c0237638c..a3ffeff83 100644 --- a/example/cppcon_2014/matrix/matrix.hpp +++ b/example/cppcon_2014/matrix/matrix.hpp @@ -7,14 +7,14 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_MATRIX_HPP #define BOOST_HANA_EXAMPLE_CPPCON_2014_MATRIX_MATRIX_HPP -#include -#include +#include #include #include #include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/example/cppcon_2014/matrix/monoid.hpp b/example/cppcon_2014/matrix/monoid.hpp index 8a3ffc8df..67bc31555 100644 --- a/example/cppcon_2014/matrix/monoid.hpp +++ b/example/cppcon_2014/matrix/monoid.hpp @@ -10,9 +10,9 @@ Distributed under the Boost Software License, Version 1.0. #include "matrix.hpp" #include -#include -#include -#include +#include +#include +#include namespace boost { namespace hana { diff --git a/example/cppcon_2014/matrix/ring.hpp b/example/cppcon_2014/matrix/ring.hpp index fd7cca388..7a6287d32 100644 --- a/example/cppcon_2014/matrix/ring.hpp +++ b/example/cppcon_2014/matrix/ring.hpp @@ -9,14 +9,14 @@ Distributed under the Boost Software License, Version 1.0. #include "matrix.hpp" -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/example/enumerable.cpp b/example/enumerable.cpp index 9e885eed4..7ed339ade 100644 --- a/example/enumerable.cpp +++ b/example/enumerable.cpp @@ -5,10 +5,8 @@ Distributed under the Boost Software License, Version 1.0. */ #include -#include -#include -#include -#include +#include +#include using namespace boost::hana; diff --git a/example/integral_constant.cpp b/example/integral_constant.cpp index 8cf70bdef..a77960a1b 100644 --- a/example/integral_constant.cpp +++ b/example/integral_constant.cpp @@ -20,7 +20,7 @@ int main() { ); BOOST_HANA_CONSTANT_ASSERT(equal( - integral_constant, + integral_constant, std::true_type{} )); //! [integral_constant] diff --git a/example/list/applicative.cpp b/example/list/applicative.cpp index d5b7cb018..5a179ba0e 100644 --- a/example/list/applicative.cpp +++ b/example/list/applicative.cpp @@ -19,7 +19,7 @@ using namespace boost::hana; int main() { //! [main] BOOST_HANA_CONSTEXPR_ASSERT(lift('x') == tuple('x')); - BOOST_HANA_CONSTEXPR_ASSERT(equal(lift('x'), std::make_tuple('x'))); + BOOST_HANA_CONSTEXPR_ASSERT(equal(lift('x'), std::make_tuple('x'))); BOOST_HANA_CONSTEXPR_LAMBDA auto f = pair; BOOST_HANA_CONSTEXPR_LAMBDA auto g = flip(pair); diff --git a/example/record/howto.cpp b/example/record/howto.cpp index fb115612c..8a150c2dc 100644 --- a/example/record/howto.cpp +++ b/example/record/howto.cpp @@ -13,10 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include -#include -#include -#include -#include +#include #include #include diff --git a/example/record/macros.cpp b/example/record/macros.cpp index 909088942..d33eadb4d 100644 --- a/example/record/macros.cpp +++ b/example/record/macros.cpp @@ -5,7 +5,7 @@ Distributed under the Boost Software License, Version 1.0. */ #define BOOST_PP_VARIADICS 1 -#include +#include #include #include diff --git a/include/boost/hana/applicative.hpp b/include/boost/hana/applicative.hpp index e4c21c2f3..8d8eb8418 100644 --- a/include/boost/hana/applicative.hpp +++ b/include/boost/hana/applicative.hpp @@ -10,8 +10,12 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_APPLICATIVE_HPP #define BOOST_HANA_APPLICATIVE_HPP -#include -#include -#include +#include + + +namespace boost { namespace hana { + //! Minimal complete definition : `lift` and `ap` + struct Applicative::mcd { }; +}} // end namespace boost::hana #endif // !BOOST_HANA_APPLICATIVE_HPP diff --git a/include/boost/hana/applicative/list_mcd.hpp b/include/boost/hana/applicative/list_mcd.hpp deleted file mode 100644 index a65f9085a..000000000 --- a/include/boost/hana/applicative/list_mcd.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*! -@file -Defines `boost::hana::Applicative::list_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_APPLICATIVE_LIST_MCD_HPP -#define BOOST_HANA_APPLICATIVE_LIST_MCD_HPP - -#include - -#include -#include -#include -#include -#include -#include - - -namespace boost { namespace hana { - //! Minimal complete definition: `Functor` and `List` - template - struct Applicative::list_mcd { - template - static constexpr decltype(auto) lift_impl(X&& x) - { return cons(detail::std::forward(x), nil); } - - template - static constexpr decltype(auto) ap_impl(Fs&& fs, Xs&& xs) { - return bind( - detail::std::forward(fs), - [xs(detail::std::forward(xs))](auto&& f) -> decltype(auto) { - return fmap(xs, detail::std::forward(f)); - } - ); - } - }; - - //! `Applicative` instance for instances of the `List` type class. - //! - //! A value can be lifted into a singleton list with `lift`. `ap(fs, xs)` - //! applies each function in the list `fs` to each value in the list `xs`, - //! and returns a list containing all the results. - //! - //! ### Example - //! @snippet example/list/applicative.cpp main - template - struct Applicative::instance()>> - : Applicative::list_mcd - { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_APPLICATIVE_LIST_MCD_HPP diff --git a/include/boost/hana/applicative/mcd.hpp b/include/boost/hana/applicative/mcd.hpp deleted file mode 100644 index a88a67a00..000000000 --- a/include/boost/hana/applicative/mcd.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/*! -@file -Defines `boost::hana::Applicative::mcd`. - -@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) - */ - -#ifndef BOOST_HANA_APPLICATIVE_MCD_HPP -#define BOOST_HANA_APPLICATIVE_MCD_HPP - -#include - - -namespace boost { namespace hana { - //! Minimal complete definition : `lift` and `ap` - struct Applicative::mcd { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_APPLICATIVE_MCD_HPP diff --git a/include/boost/hana/bool.hpp b/include/boost/hana/bool.hpp index 0d9c84531..d9f0e226a 100644 --- a/include/boost/hana/bool.hpp +++ b/include/boost/hana/bool.hpp @@ -10,11 +10,48 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_BOOL_HPP #define BOOST_HANA_BOOL_HPP -#include +#include -// Instances -#include -#include -#include +#include + +// instances +#include +#include +#include + + +namespace boost { namespace hana { + template <> + struct Comparable::instance : Comparable::equal_mcd { + template + static constexpr auto equal_impl(X const&, Y const&) + { return bool_; } + }; + + template <> + struct Constant::instance : Constant::mcd { + template + static constexpr auto value_impl(C const&) + { return C::value; } + }; + + template <> + struct Logical::instance : Logical::mcd { + //! @bug + //! We can't use perfect forwarding because of this bug: + //! http://llvm.org/bugs/show_bug.cgi?id=20619 + template + static constexpr auto eval_if_impl(decltype(true_), T t, E) + { return t(id); } + + template + static constexpr auto eval_if_impl(decltype(false_), T, E e) + { return e(id); } + + template + static constexpr auto not_impl(C const&) + { return bool_; } + }; +}} // end namespace boost::hana #endif // !BOOST_HANA_BOOL_HPP diff --git a/include/boost/hana/bool/comparable.hpp b/include/boost/hana/bool/comparable.hpp deleted file mode 100644 index ff6109937..000000000 --- a/include/boost/hana/bool/comparable.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/*! -@file -Defines the instance of `boost::hana::Comparable` for `boost::hana::Bool`. - -@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) - */ - -#ifndef BOOST_HANA_BOOL_COMPARABLE_HPP -#define BOOST_HANA_BOOL_COMPARABLE_HPP - -#include -#include - - -namespace boost { namespace hana { - template <> - struct Comparable::instance : Comparable::equal_mcd { - template - static constexpr auto equal_impl(X const&, Y const&) - { return bool_; } - }; -}} - -#endif // !BOOST_HANA_BOOL_COMPARABLE_HPP diff --git a/include/boost/hana/bool/constant.hpp b/include/boost/hana/bool/constant.hpp deleted file mode 100644 index 9c9990397..000000000 --- a/include/boost/hana/bool/constant.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/*! -@file -Defines the instance of `boost::hana::Constant` for `boost::hana::Bool`. - -@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) - */ - -#ifndef BOOST_HANA_BOOL_CONSTANT_HPP -#define BOOST_HANA_BOOL_CONSTANT_HPP - -#include -#include - - -namespace boost { namespace hana { - template <> - struct Constant::instance : Constant::mcd { - template - static constexpr auto value_impl(C const&) - { return C::value; } - }; -}} - -#endif // !BOOST_HANA_BOOL_CONSTANT_HPP diff --git a/include/boost/hana/bool/logical.hpp b/include/boost/hana/bool/logical.hpp deleted file mode 100644 index 62b4793b6..000000000 --- a/include/boost/hana/bool/logical.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*! -@file -Defines the instance of `boost::hana::Logical` for `boost::hana::Bool`. - -@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) - */ - -#ifndef BOOST_HANA_BOOL_LOGICAL_HPP -#define BOOST_HANA_BOOL_LOGICAL_HPP - -#include -#include -#include - - -namespace boost { namespace hana { - template <> - struct Logical::instance : Logical::mcd { - //! @bug - //! We can't use perfect forwarding because of this bug: - //! http://llvm.org/bugs/show_bug.cgi?id=20619 - template - static constexpr auto eval_if_impl(decltype(true_), T t, E) - { return t(id); } - - template - static constexpr auto eval_if_impl(decltype(false_), T, E e) - { return e(id); } - - template - static constexpr auto not_impl(C const&) - { return bool_; } - }; -}} - -#endif // !BOOST_HANA_BOOL_LOGICAL_HPP diff --git a/include/boost/hana/comparable.hpp b/include/boost/hana/comparable.hpp index 72d9bfe74..505ed3831 100644 --- a/include/boost/hana/comparable.hpp +++ b/include/boost/hana/comparable.hpp @@ -10,13 +10,86 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_COMPARABLE_HPP #define BOOST_HANA_COMPARABLE_HPP -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include + + +namespace boost { namespace hana { + namespace operators { + //! Equivalent to `equal`. + //! @relates boost::hana::Comparable + template >::value || + enable_operators>::value + >> + constexpr decltype(auto) operator==(X&& x, Y&& y) { + return equal(detail::std::forward(x), + detail::std::forward(y)); + } + + //! Equivalent to `not_equal`. + //! @relates boost::hana::Comparable + template >::value || + enable_operators>::value + >> + constexpr decltype(auto) operator!=(X&& x, Y&& y) { + return not_equal(detail::std::forward(x), + detail::std::forward(y)); + } + } + + //! Minimal complete definition : `equal` + struct Comparable::equal_mcd { + template + static constexpr decltype(auto) not_equal_impl(X&& x, Y&& y) { + return not_(equal( + detail::std::forward(x), + detail::std::forward(y) + )); + } + }; + + //! Minimal complete definition : `not_equal` + struct Comparable::not_equal_mcd { + template + static constexpr decltype(auto) equal_impl(X&& x, Y&& y) { + return not_(not_equal( + detail::std::forward(x), + detail::std::forward(y) + )); + } + }; +}} // end namespace boost::hana + +#include +#include + +namespace boost { namespace hana { + //! Default instance for the `Comparable` type class. + //! + //! Objects of different data types that do not define a `Comparable` + //! instance are implicitly `Comparable` by letting any two such objects + //! always compare unequal. However, objects of the same data type are + //! not implicitly `Comparable`, and trying to compare two objects of + //! the same data type that do not define a `Comparable` instance will + //! result in a compile-time error. + template + struct Comparable::default_instance : Comparable::equal_mcd { + template + static constexpr auto equal_impl(X const&, Y const&) + { return false_; } + }; + + template + struct Comparable::default_instance : disable { + // We let it fail if T is not comparable with itself. + }; +}} // end namespace boost::hana #endif // !BOOST_HANA_COMPARABLE_HPP diff --git a/include/boost/hana/comparable/default.hpp b/include/boost/hana/comparable/default.hpp deleted file mode 100644 index fc8fb17cf..000000000 --- a/include/boost/hana/comparable/default.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*! -@file -Defines the default instance for `boost::hana::Comparable`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_DEFAULT_HPP -#define BOOST_HANA_COMPARABLE_DEFAULT_HPP - -#include -#include -#include - - -namespace boost { namespace hana { - //! Default instance for the `Comparable` type class. - //! - //! Objects of different data types that do not define a `Comparable` - //! instance are implicitly `Comparable` by letting any two such objects - //! always compare unequal. However, objects of the same data type are - //! not implicitly `Comparable`, and trying to compare two objects of - //! the same data type that do not define a `Comparable` instance will - //! result in a compile-time error. - template - struct Comparable::default_instance : Comparable::equal_mcd { - template - static constexpr auto equal_impl(X const&, Y const&) - { return false_; } - }; - - template - struct Comparable::default_instance : disable { - // We let it fail if T is not comparable with itself. - }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_DEFAULT_HPP diff --git a/include/boost/hana/comparable/equal_mcd.hpp b/include/boost/hana/comparable/equal_mcd.hpp deleted file mode 100644 index d736ecc33..000000000 --- a/include/boost/hana/comparable/equal_mcd.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*! -@file -Defines `boost::hana::Comparable::equal_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_EQUAL_MCD_HPP -#define BOOST_HANA_COMPARABLE_EQUAL_MCD_HPP - -#include -#include -#include - - -namespace boost { namespace hana { - //! Minimal complete definition : `equal` - struct Comparable::equal_mcd { - template - static constexpr decltype(auto) not_equal_impl(X&& x, Y&& y) { - return not_(equal( - detail::std::forward(x), - detail::std::forward(y) - )); - } - }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_EQUAL_MCD_HPP - -#include //! @todo remove this include diff --git a/include/boost/hana/comparable/integral_constant_mcd.hpp b/include/boost/hana/comparable/integral_constant_mcd.hpp deleted file mode 100644 index 1e79bba2b..000000000 --- a/include/boost/hana/comparable/integral_constant_mcd.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*! -@file -Defines `boost::hana::Comparable::integral_constant_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_INTEGRAL_CONSTANT_MCD_HPP -#define BOOST_HANA_COMPARABLE_INTEGRAL_CONSTANT_MCD_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace boost { namespace hana { - template - struct Comparable::integral_constant_mcd : Comparable::equal_mcd { - template - static constexpr decltype(auto) equal_impl(X x, Y y) { - constexpr auto eq = value(x) == value(y); - return integral_constant; - } - }; - - template - struct Comparable::instance() && - detail::std::is_integral{} - >> - : Comparable::equal_mcd - { - template - static constexpr decltype(auto) equal_impl(X&& x, Y&& y) { - return value(detail::std::forward(x)) == - detail::std::forward(y); - } - }; - - template - struct Comparable::instance{} && - is_an() - >> - : Comparable::equal_mcd - { - template - static constexpr decltype(auto) equal_impl(X&& x, Y&& y) { - return detail::std::forward(x) == - value(detail::std::forward(y)); - } - }; - - template - struct Comparable::instance() && - is_an() - >> - : Comparable::integral_constant_mcd - { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_INTEGRAL_CONSTANT_MCD_HPP diff --git a/include/boost/hana/comparable/list_mcd.hpp b/include/boost/hana/comparable/list_mcd.hpp deleted file mode 100644 index 35f113dea..000000000 --- a/include/boost/hana/comparable/list_mcd.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*! -@file -Defines `boost::hana::Comparable::list_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_LIST_MCD_HPP -#define BOOST_HANA_COMPARABLE_LIST_MCD_HPP - -#include -#include -#include -#include -#include -#include - - -namespace boost { namespace hana { - //! Minimal complete definition: `List` - struct Comparable::list_mcd - : Comparable::equal_mcd - { - template - static constexpr decltype(auto) equal_impl(Xs const& xs, Ys const& ys) { - return eval_if(or_(is_empty(xs), is_empty(ys)), - [&xs, &ys](auto _) -> decltype(auto) { - return and_(_(is_empty)(xs), _(is_empty)(ys)); - }, - [&xs, &ys](auto _) -> decltype(auto) { - return and_(equal(_(head)(xs), _(head)(ys)), - equal_impl(_(tail)(xs), _(tail)(ys))); - } - ); - } - }; - - //! Instance of `Comparable` for instances of `List`. - //! - //! Two `List`s are equal if and only if they contain the same number - //! of elements and their elements at any given index are equal. - //! - //! ### Example - //! @snippet example/list/comparable.cpp main - template - struct Comparable::instance() && is_a() - >> - : Comparable::list_mcd - { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_LIST_MCD_HPP - -#include //! @todo remove this include diff --git a/include/boost/hana/comparable/not_equal_mcd.hpp b/include/boost/hana/comparable/not_equal_mcd.hpp deleted file mode 100644 index 716fd012f..000000000 --- a/include/boost/hana/comparable/not_equal_mcd.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*! -@file -Defines `boost::hana::Comparable::not_equal_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_NOT_EQUAL_MCD_HPP -#define BOOST_HANA_COMPARABLE_NOT_EQUAL_MCD_HPP - -#include -#include -#include - - -namespace boost { namespace hana { - //! Minimal complete definition : `not_equal` - struct Comparable::not_equal_mcd { - template - static constexpr decltype(auto) equal_impl(X&& x, Y&& y) { - return not_(not_equal( - detail::std::forward(x), - detail::std::forward(y) - )); - } - }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_NOT_EQUAL_MCD_HPP - -#include //! @todo remove this include diff --git a/include/boost/hana/comparable/operators.hpp b/include/boost/hana/comparable/operators.hpp deleted file mode 100644 index c174a046b..000000000 --- a/include/boost/hana/comparable/operators.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*! -@file -Defines custom operators for `boost::hana::Comparable`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_OPERATORS_HPP -#define BOOST_HANA_COMPARABLE_OPERATORS_HPP - -#include - -#include -#include -#include -#include - - -namespace boost { namespace hana { namespace operators { - //! Equivalent to `equal`. - //! @relates boost::hana::Comparable - template >::value || - enable_operators>::value - >> - constexpr decltype(auto) operator==(X&& x, Y&& y) { - return equal(detail::std::forward(x), - detail::std::forward(y)); - } - - //! Equivalent to `not_equal`. - //! @relates boost::hana::Comparable - template >::value || - enable_operators>::value - >> - constexpr decltype(auto) operator!=(X&& x, Y&& y) { - return not_equal(detail::std::forward(x), - detail::std::forward(y)); - } -}}} // end namespace boost::hana::operators - -#endif // !BOOST_HANA_COMPARABLE_OPERATORS_HPP diff --git a/include/boost/hana/comparable/product_mcd.hpp b/include/boost/hana/comparable/product_mcd.hpp deleted file mode 100644 index c270ec798..000000000 --- a/include/boost/hana/comparable/product_mcd.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*! -@file -Defines `boost::hana::Comparable::product_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_PRODUCT_MCD_HPP -#define BOOST_HANA_COMPARABLE_PRODUCT_MCD_HPP - -#include -#include -#include -#include -#include - - -namespace boost { namespace hana { - //! Mininal complete definition: `Product` - struct Comparable::product_mcd : Comparable::equal_mcd { - template - static constexpr decltype(auto) equal_impl(X const& x, Y const& y) { - return and_( - equal(first(x), first(y)), - equal(second(x), second(y)) - ); - } - }; - - //! Instance of `Comparable` for `Product`s. - //! - //! Two products `x` and `y` are equal iff they are equal element-wise, - //! i.e. iff - //! @code - //! first(x) == first(y) && second(x) == second(y) - //! @endcode - //! - //! ### Example - //! @snippet example/product.cpp comparable - template - struct Comparable::instance() && is_a() - >> : Comparable::product_mcd { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_PRODUCT_MCD_HPP diff --git a/include/boost/hana/comparable/record_mcd.hpp b/include/boost/hana/comparable/record_mcd.hpp deleted file mode 100644 index 8d24dc651..000000000 --- a/include/boost/hana/comparable/record_mcd.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*! -@file -Defines `boost::hana::Comparable::record_mcd`. - -@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) - */ - -#ifndef BOOST_HANA_COMPARABLE_RECORD_MCD_HPP -#define BOOST_HANA_COMPARABLE_RECORD_MCD_HPP - -#include -#include -#include -#include -#include -#include - - -namespace boost { namespace hana { - template - struct Comparable::record_mcd : Comparable::equal_mcd { - template - static constexpr decltype(auto) equal_impl(X const& x, Y const& y) { - return all(members, [&x, &y](auto&& member) -> decltype(auto) { - auto accessor = second(detail::std::forward(member)); - return equal(accessor(x), accessor(y)); - }); - } - }; - - //! Two `Records` of the same data type `R` are equal if and only if - //! all their members are equal. The members are compared in the - //! same order as they appear in `members`. - template - struct Comparable::instance()>> - : Comparable::record_mcd - { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_COMPARABLE_RECORD_MCD_HPP diff --git a/include/boost/hana/constant.hpp b/include/boost/hana/constant.hpp index 284549de5..dd097a8f5 100644 --- a/include/boost/hana/constant.hpp +++ b/include/boost/hana/constant.hpp @@ -10,7 +10,12 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_CONSTANT_HPP #define BOOST_HANA_CONSTANT_HPP -#include -#include +#include + + +namespace boost { namespace hana { + //! Minimal complete definition: `value` + struct Constant::mcd { }; +}} // end namespace boost::hana #endif // !BOOST_HANA_CONSTANT_HPP diff --git a/include/boost/hana/constant/mcd.hpp b/include/boost/hana/constant/mcd.hpp deleted file mode 100644 index 0c3bf1a9e..000000000 --- a/include/boost/hana/constant/mcd.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/*! -@file -Defines `boost::hana::Constant::mcd`. - -@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) - */ - -#ifndef BOOST_HANA_CONSTANT_MCD_HPP -#define BOOST_HANA_CONSTANT_MCD_HPP - -#include - - -namespace boost { namespace hana { - //! Minimal complete definition: `value` - struct Constant::mcd { }; -}} // end namespace boost::hana - -#endif // !BOOST_HANA_CONSTANT_MCD_HPP diff --git a/include/boost/hana/core/is_a.hpp b/include/boost/hana/core/is_a.hpp index bc1554349..fc488d895 100644 --- a/include/boost/hana/core/is_a.hpp +++ b/include/boost/hana/core/is_a.hpp @@ -10,9 +10,9 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_CORE_IS_A_HPP #define BOOST_HANA_CORE_IS_A_HPP -#include #include #include +#include namespace boost { namespace hana { diff --git a/include/boost/hana/detail/assert.hpp b/include/boost/hana/detail/assert.hpp index aa359f512..a0d950c01 100644 --- a/include/boost/hana/detail/assert.hpp +++ b/include/boost/hana/detail/assert.hpp @@ -10,7 +10,7 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_DETAIL_ASSERT_HPP #define BOOST_HANA_DETAIL_ASSERT_HPP -#include +#include #include #include diff --git a/include/boost/hana/detail/variadic/foldl.hpp b/include/boost/hana/detail/variadic/foldl.hpp index db2d6cd23..e69d9beda 100644 --- a/include/boost/hana/detail/variadic/foldl.hpp +++ b/include/boost/hana/detail/variadic/foldl.hpp @@ -14,7 +14,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include -#include +#include namespace boost { namespace hana { namespace detail { namespace variadic { diff --git a/include/boost/hana/detail/variadic/foldl1.hpp b/include/boost/hana/detail/variadic/foldl1.hpp index e2a689a8f..e51b4ad6f 100644 --- a/include/boost/hana/detail/variadic/foldl1.hpp +++ b/include/boost/hana/detail/variadic/foldl1.hpp @@ -13,7 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include -#include +#include namespace boost { namespace hana { namespace detail { namespace variadic { diff --git a/include/boost/hana/detail/variadic/foldr.hpp b/include/boost/hana/detail/variadic/foldr.hpp index e825d3547..8b4edc123 100644 --- a/include/boost/hana/detail/variadic/foldr.hpp +++ b/include/boost/hana/detail/variadic/foldr.hpp @@ -14,7 +14,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include -#include +#include namespace boost { namespace hana { namespace detail { namespace variadic { diff --git a/include/boost/hana/detail/variadic/foldr1.hpp b/include/boost/hana/detail/variadic/foldr1.hpp index 51ae59de9..ee99d6c92 100644 --- a/include/boost/hana/detail/variadic/foldr1.hpp +++ b/include/boost/hana/detail/variadic/foldr1.hpp @@ -12,7 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include -#include +#include namespace boost { namespace hana { namespace detail { namespace variadic { diff --git a/include/boost/hana/either.hpp b/include/boost/hana/either.hpp index 7560bfcdd..c8215c87d 100644 --- a/include/boost/hana/either.hpp +++ b/include/boost/hana/either.hpp @@ -10,13 +10,118 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_HANA_EITHER_HPP #define BOOST_HANA_EITHER_HPP -#include +#include -// Instances -#include -#include -#include +#include +#include +#include -#include +// instances +#include +#include +#include +#include + + +namespace boost { namespace hana { + //! Instance of `Comparable` for `Either`s. + //! + //! Two `Either`s are equal if and only if they both contain left values + //! or they both contain right values and those values are equal. + //! + //! ### Example + //! @snippet example/either.cpp comparable + template <> + struct Comparable::instance : Comparable::equal_mcd { + template