Commit Graph

1973 Commits

Author SHA1 Message Date
Louis Dionne
e20239a0d0 [assert.hpp] Use ::value instead of {}() in static_asserts 2015-08-03 19:24:24 +02:00
Louis Dionne
78f056a25c [example.switchAny] Update the tutorial to use hana::pair and default_t instead of _default 2015-07-28 20:23:21 +02:00
Louis Dionne
8036357a37 Use detail::fast_and instead of more involved hana::all on bool array 2015-07-28 20:23:21 +02:00
Louis Dionne
e64c57d6e6 [at] Add missing cstddef include 2015-07-26 18:06:16 +02:00
Louis Dionne
96b0cc3169 [GCC] Fix some GCC warnings and errors 2015-07-26 18:06:16 +02:00
Louis Dionne
aea2196cf7 [iterate] Workaround hitting recursive instantiation limit with libstdc++ 2015-07-26 17:25:54 +02:00
Louis Dionne
7af88b6cc3 [fusion::deque] Workaround Boost 1.57.0 bug triggered in tail 2015-07-26 13:53:40 +02:00
Louis Dionne
2027593022 [Tutorial] Remove misplaced comma 2015-07-26 12:42:20 +02:00
Louis Dionne
0893ae57f7 [Fusion adapters] Don't test the full laws, only the implemented methods
The Fusion adapters have been giving me trouble for a long time now.
The problem is that Hana's unit tests are more thorough than Fusion's,
and hence we keep uncovering Fusion bugs through Hana's unit tests.
This keeps on breaking the build and makes me lose valuable time trying
to workaround these bugs until they are fixed in Fusion's master branch.

Therefore, only the methods that are implemented by Fusion adapters are
tested to make sure they work as expected, but the other algorithms that
are derived from them are not tested on Fusion adapters.
2015-07-26 12:42:20 +02:00
Louis Dionne
9d74084996 Remove take_until and some xxx_exactly variants
Of the xxx_exactly variants, only drop_front_exactly is kept for now,
because it actually allows an optimization. The other ones did not
really provide a compile-time improvement, so they are removed.
2015-07-26 12:42:20 +02:00
Louis Dionne
70cd321751 [example.SwitchAny] Use Hana's pair instead of broken std::pair
libc++'s std::pair always has a default constructor, and it is ill-formed
when the members are not default constructible. We need it to be SFINAE
friendly. See https://llvm.org/bugs/show_bug.cgi?id=21917.
2015-07-26 12:42:20 +02:00
Louis Dionne
8a0ddb0fa7 [Closure] Reimplement the closure to be almost standards-conforming
Also, use that closure to implement basically all containers.
The new closure compresses empty types.

Fixes #123
Fixes #93
Fixes #89
2015-07-26 12:42:20 +02:00
Louis Dionne
c854278994 [Travis] Temporarily disable testing on Clang-3.7, since the clang-3.7 package can't be found 2015-07-26 12:42:19 +02:00
Louis Dionne
8145d66422 [Iterable] Require length to implement unpack 2015-07-25 16:20:48 +02:00
Louis Dionne
bf232cb5a7 [Tuple] Make the definition as minimal as possible 2015-07-25 16:20:48 +02:00
Louis Dionne
6f73c881b3 [ext::boost::Tuple] Workaround non-variadic implementation of boost::tuple
Yeah, this is a cheap workaround, but I'm not going to lose any time
with this old cruft. Sorry.
2015-07-25 16:20:48 +02:00
Louis Dionne
a42544da1e [Sequence] Enforce the finiteness of Sequences and reword the laws
Also, optimize `equal` for sequences.

Fixes #39
2015-07-25 16:20:48 +02:00
Louis Dionne
cecaf823f6 [Iterable] Replace front by at in the MCD to allow more efficient algorithm implementations
Related to #158
2015-07-25 16:20:48 +02:00
Louis Dionne
3e50562a48 [Iterable] Optimize drop_{while,front} for finite Iterables 2015-07-25 16:20:47 +02:00
Louis Dionne
d3b7cb2c85 Modularize the headers
This (large) commit introduces the following changes:
- Each algorithm lives in its own header
- The concepts are defined in the concept/ subdirectory. They define the
  `models` metafunction, some explicit default implementations (like
  Applicative::transform_impl), and they include all the algorithms
  related to that concept.
- Removed the `until` method from Logical
- Removed the `drop_until` method from Iterable
- [minor] Added the detail::nested_to utility

Closes #160
2015-07-25 16:20:47 +02:00
Louis Dionne
d2616239f2 [Travis] Explicitly enable the memory checker 2015-07-18 12:27:28 +02:00
Louis Dionne
e0b56a3d18 [README] Fix bad formatting of numbered list
[ci skip]
2015-07-07 21:43:29 +02:00
Louis Dionne
83c3b4781e [Doc] Move the tutorial out of hana.hpp
Fixes #161
2015-07-07 21:26:11 +02:00
Louis Dionne
3db57c6bca [README, Doc] Update the logo and mention that it's now officially in Boost 2015-07-07 19:47:12 +02:00
Louis Dionne
508d59cab9 [Doc] Add a cheatsheet for the data types.
Fixes #124
2015-07-02 00:22:53 +02:00
Louis Dionne
bbfd3b8a9e [Travis] Add a Travis job building with Clang + libstdc++
Also, add -ftemplate-depth=-1 in the benchmarks to avoid failures
due to hitting the recursive template instantiation limit.

Fixes #159
2015-06-30 23:53:46 +02:00
Louis Dionne
fd7b81e091 [Travis] Use COMPILER instead of CLANG_VERSION 2015-06-30 23:52:18 +02:00
Louis Dionne
52b150951d [Doc] Move prerequisites and installation to the tutorial
Fixes #128
2015-06-30 21:58:35 +02:00
Louis Dionne
a9dbb0af6f [Travis] Try to speed up the build by diminishing uses of the memory checker 2015-06-30 00:26:46 +02:00
Louis Dionne
af7db4c80e [Doc] Fix typo "names" => "named"
Thanks @Manu343726
2015-06-29 19:28:39 +02:00
Louis Dionne
dcfdb09ff9 [Struct] BOOST_HANA_ADAPT_STRUCT does not require the types of the members
Fixes #152
2015-06-28 21:01:09 +02:00
Louis Dionne
327f7893ac [std::array] Fix incorrect usage of tuple_size
Fixes #136
2015-06-28 13:18:03 +02:00
Louis Dionne
c6045da6ee [Sequence] Use underscores instead of dots to name zip variants
Also, remove unzip since it is easily implemented with unpack and zip.

Addresses #114
2015-06-28 11:43:29 +02:00
Louis Dionne
b851f5a1cb [Doc] Rename 'head' to 'front' in the tutorial 2015-06-28 10:45:09 +02:00
Louis Dionne
09955bf1b7 Use drop_front/drop_back front/back instead of asymmetrical names
- Replace init by drop_back and drop_back_exactly
- Rename head to front
- Rename last to back, and also rewrite the default implementation
  in terms of at instead of using (inefficient) recursion.
- Rename drop[_exactly] to drop_front[_exactly]
- Remove drop_c

Note that tail is kept for the moment because it is part of Iterable's
MCD. Removing tail will be the subject of a different issue.

Fixes #66
2015-06-28 10:44:28 +02:00
Louis Dionne
5f959f604e [Doc] Document the fact that conversions are documented in the source concepts 2015-06-26 18:53:40 -04:00
Louis Dionne
f82efebe76 [Docs] Add a note about the precision of benchmarks
Fixes #154
2015-06-26 15:58:01 -04:00
Louis Dionne
1e89c69049 [CMake] Remove LIBCXX_ROOT cruft and properly explain the situation in the README
Also:
- Remove the boost_hana_add_executable function, which is now useless
- Properly set the LD_LIBRARY_PATH to link against a custom libc++
- Adjust the Travis build

Fixes #135
2015-06-24 20:07:13 -04:00
Louis Dionne
37e7513e37 [Struct] Provide a better error message when using BOOST_HANA_ADAPT_STRUCT at wrong scope
Fixes #153
2015-06-24 17:02:47 -04:00
Louis Dionne
c585bdc789 [Sequence] Rename unfold<S>.{left,right} to unfold_{left,right}<S>
Partially addresses #114
2015-06-22 18:41:07 -04:00
Louis Dionne
a652e816fa [README] Precise the compiler requirements
[ci skip]
2015-06-22 15:25:18 -04:00
Louis Dionne
7ad0acf8eb [Optional] Make the constructor explicit
This is a workaround to fix #149, but a proper fix will actually require
a new closure implementation.

Fixes #149.
2015-06-21 18:03:20 -04:00
Louis Dionne
b2c3be7ec5 [Foldable] Precise the signatures of minimum and maximum
Related to #110
2015-06-21 16:10:47 -04:00
Louis Dionne
1b45d87a42 [Iterable] Rename drop.at_most to drop and drop.exactly to drop_exactly
Partially addresses #114
2015-06-21 12:08:23 -04:00
Louis Dionne
46207eed20 [Sequence] Rename take.at_most to take, and take.exactly to take_exactly
Partially addresses #114
2015-06-21 11:50:02 -04:00
Louis Dionne
1959c49f4b [Doc] Precise the rationale about tag dispatching
Explain that it forces the user to check semantic requirements.

Addresses #144
2015-06-21 10:00:52 -04:00
Louis Dionne
4bef99d3d0 [Core] Completely remove operators from the core
Properly providing operators for users was too complicated, and it is
judged as being out of Hana's scope.

Instead, operators are now provided by helper classes in the detail::
namespace. Now, we can be as dirty as we want, since it is not part of
the interface anymore.

Fixes #138
Closes #30
2015-06-20 17:56:40 -04:00
Louis Dionne
93a3cc8f75 [Doc] Add a rationale for using tag-dispatching
Also, precise how the branches of the if_ are affected by the semantics
of the capture.

Fixes #144
2015-06-20 17:48:01 -04:00
Louis Dionne
c4ac6d67be [Doc] Make the quickstart examples self-contained
Fixes #137
2015-06-18 21:39:27 -04:00
Louis Dionne
41c9d6e032 [CMake] Switch BOOST_HANA_ENABLE_LIBCXX to OFF by default
No -stdlib=libc++ is usually the right behavior

Fixes #135
2015-06-17 22:04:57 -04:00