Commit Graph

1208 Commits

Author SHA1 Message Date
Vittorio Romeo
427cc202d6 Use hana::detail::decay instead of std::decay in implementation
* In implementation code, occurrences of `typename std::decay<...>::type` have
  been replaced with `typename hana::detail::decay<...>::type`.

* The rationale for this change, as mentioned in #282, is that
  `hana::detail::decay` performs better than `std::decay` in "libc++".
  I also think that using the same `decay` implementation throughout the
  library is more consistent.

[ldionne: wrap commit message at 80 columns and squash 3 commits
Closes #284
]
2016-06-12 12:31:44 -07:00
Vittorio Romeo
2641844267 Change return type of single-argument overload to typename detail::decay<F>::type 2016-05-29 09:53:06 -07:00
Vittorio Romeo
89755947fa [overload_linearly] Allow overload_linearly to be called with a single argument
Added an `make_overload_linearly_t::operator()` overload that takes a
single argument, and simply returns the argument

[ldionne: wrap commit message]
2016-05-29 09:52:28 -07:00
Louis Dionne
3ccd7b5fd9 [types] Accept non-metafunctions returning references to types in transform
Fixes #266
2016-04-06 18:42:21 -04:00
Louis Dionne
9082e9ff05 [version] Bump to 1.0.0 2016-03-20 10:32:23 -04:00
Louis Dionne
8bec9806b2 [version] Improve formulation of comment. NFC 2016-03-20 10:29:01 -04:00
Louis Dionne
63c5f87dfd [GCC] Update warnings and documentation to support GCC 2016-03-07 16:46:08 -05:00
Louis Dionne
ec74204588 [scans] Fix undefined behaviour in scan_right and optimize both algorithms 2016-03-05 16:41:47 -05:00
Louis Dionne
036275f615 [tuple] Remove useless @cond 2016-03-05 14:22:03 -05:00
Louis Dionne
6d364970cc [map] Optimize make_map by requiring distinct hashes
This allows us to create large maps quite efficiently. If one needs
to create a map with duplicate keys or keys whose hashes may collide,
the inefficient to_map can be used instead.
2016-02-29 10:55:01 -05:00
Louis Dionne
aa47c09a55 [map] Use a basic_tuple for storage 2016-02-29 10:42:47 -05:00
Louis Dionne
a757f7fb7c [basic_tuple] Provide a model for Iterable and Sequence
Also remove the ad-hoc model of Comparable, which is now obsolete.
2016-02-29 10:23:41 -05:00
Louis Dionne
df94a16210 [basic_tuple] Provide a model for Functor 2016-02-27 14:36:57 -05:00
Louis Dionne
3bea6c0ab0 [basic_tuple] Add a working copy constructor 2016-02-27 14:36:57 -05:00
Louis Dionne
b84be1dcca Bump version to 0.8.0 2016-02-27 14:36:56 -05:00
Louis Dionne
70c61dcfca [set,map] Add Hashable and Comparable requirement to the keys of a set
That will allow us to implement the set using a hash table in the future.
2016-02-21 10:47:38 -05:00
Louis Dionne
c30c0f3c8d [optional] Specify the template parameters of optional
Closes #254
2016-02-21 10:24:32 -05:00
Louis Dionne
477368ed8b [hash_table] Add a peephole optimization for 1-element buckets
This optimization shaves off approximately 1 second on the
at_key.number_of_lookups benchmark when looking up 140 elements.
2016-02-19 16:42:34 -05:00
Louis Dionne
5a5eb6548e [traits] Remove usage of decltype_t in traits.
These should have been removed in b1696fe, which removed implicit
support for decltype_ when calling metafunctions.
2016-02-19 16:34:43 -05:00
Louis Dionne
1e3b166c56 [doc] Properly mark more template parameters as implementation-defined 2016-02-19 16:33:16 -05:00
Sergey Nizovtsev
5d07902329 Correctly forward std::extent value_type to hana::traits::extent
Fixes #252
2016-02-19 22:13:26 +03:00
Louis Dionne
f068f2d092 [doc] Remove experimental::types from the main "Data types" section 2016-02-18 13:00:57 -05:00
Louis Dionne
eaa4cd7f8e [map] Reimplement hana::map using a hash table 2016-02-16 15:50:41 -05:00
Louis Dionne
3a2ad0b2b5 [Hashable] Improve documentation and tests 2016-02-16 15:24:23 -05:00
Jason Rice
da29858d1b [hash] type-level hash for associative containers
- Hashable concept
    - hash function
2016-02-16 15:24:23 -05:00
Louis Dionne
e5e9c44825 [types] Add a fast contains function based on detail::any_of 2016-02-15 10:14:03 -05:00
Louis Dionne
ce03e0cc75 [detail] Add a fast any_of metafunction using SFINAE 2016-02-15 10:14:03 -05:00
Louis Dionne
357aeea527 [experimental] Add types<>, a Sequence specialized for holding types 2016-02-15 10:14:03 -05:00
Louis Dionne
b1696fe0cc [Metafunction] Do not automatically call decltype_ on metafunction arguments 2016-02-15 10:07:08 -05:00
Louis Dionne
6e257fa7e1 [flatten] Extract the computation into unpack_flatten 2016-02-12 15:16:49 -05:00
Louis Dionne
18346fd8a1 [doc][value] Add note about value being an overloaded function 2016-02-12 12:42:19 -05:00
Louis Dionne
7f7c7a19a9 [core] Add embedding from char to any integral type with proper signedness 2016-02-11 11:28:10 -05:00
Louis Dionne
31aa2e6f60 [core] Use signed keyword on signed integer types to define embeddings 2016-02-11 11:18:11 -05:00
Louis Dionne
30be9a677a [core] Mark conversion from 'char' to 'short' as embedding 2016-02-11 10:42:35 -05:00
Louis Dionne
80b78deee1 [doc] Fix typos in integral_constant 2016-02-07 11:30:29 -05:00
Louis Dionne
75f6be09ce Return references from at, at_key & friends
Resolves #90
2016-02-05 18:19:23 -05:00
Louis Dionne
da0c4975da Use T const& instead of T&& for keys in find and at_key
Using T&& is pointless and it makes the code slightly more complex.
2016-02-05 18:19:23 -05:00
Jason Rice
bae4dc1d8d [documentation] operator documentation 2016-02-05 18:14:17 -05:00
Louis Dionne
91b7977df3 [map] Make the template parameters of hana::map implementation-defined
Also, use implementation_defined instead of implementation-defined
as a keyword in the documentation, since implementation-defined is
sometimes mis-rendered by Doxygen.
2016-01-31 15:05:18 -05:00
Louis Dionne
f0ea20f7e8 [map] Add a default constructor
Closes #197
2016-01-31 14:51:48 -05:00
Louis Dionne
c8a886d649 [sort] Reimplement sort with a type-level insertion sort 2016-01-27 18:20:53 -05:00
Louis Dionne
65e1aa850f Add benchmarks for the sort algorithm 2016-01-27 16:15:43 -05:00
Louis Dionne
bfbb9f826c [sort] Make the requirements of the predicate more strict 2016-01-27 16:15:43 -05:00
Louis Dionne
73a7c5aba9 [benchmarks] Add benchmarks for at_key and find_if
Also slightly improve the benchmarking framework:
  - Allow passing an additional environment to benchmarks
  - Add the directory of the .erb.cpp file to the include path
  - Output stdout when a compilation error occurs
2016-01-25 20:11:50 -05:00
Louis Dionne
c34f0d0f61 [doc] Add a link to the section on tag-dispatching from hana::when
Addresses a question asked on Gitter.
2016-01-22 07:55:38 -05:00
Jason Rice
2b0ede886e [printable] metafunctions 2016-01-18 15:27:00 -05:00
Louis Dionne
9b93fb0eb0 Add experimental views
Closes #193
2016-01-15 10:17:46 -05:00
Louis Dionne
dc90dc52d0 Fix some Boost-inspect errors
- Non-ASCII characters
- Files not ending with a newline
- Missing copyright notices
2016-01-13 12:38:09 -05:00
Louis Dionne
6f1d408c00 [doc] Turn concepts into groups in the documentation
Fixes #133:
    Each function now automatically documents the file where it is
    declared.

Partially addresses #233:
    The alphabetical index now works properly
2016-01-12 11:01:30 -05:00
Louis Dionne
81ddcfafaf Rename take to take_front
This improves consistency:
drop_front/drop_back
take_front/take_back
2016-01-12 10:10:03 -05:00
Louis Dionne
131c56c32a Add the take_back algorithm 2016-01-12 10:00:11 -05:00
Louis Dionne
d60646237d [core] Rename core/convert.hpp to core/to.hpp 2016-01-10 18:32:57 -05:00
Louis Dionne
ed308613a8 [doc] Fix issue with undocumented boost::hana namespace 2016-01-09 14:16:55 -08:00
Louis Dionne
72adb9ee51 [Doc] Fix minor nitpick with for_each's documented definition 2016-01-06 15:30:37 -05:00
Louis Dionne
7e04b36268 Add BOOST_HANA_ENABLE_DEBUG_MODE and optional checks in make_set and make_map
Closes #230
2016-01-06 09:25:41 -05:00
Louis Dionne
5e62da18a1 [string] Modularize the unit tests
Also workaround a missing #include in string.hpp
2016-01-04 10:34:18 -05:00
Louis Dionne
c41a5cb6be Update copyright notices for 2016 2016-01-01 14:54:06 -05:00
Jason Rice
b7ee8d750d [bug] predicate to bool in find_if default impl
Related #221
 - decay result of predicate
2015-12-22 11:01:19 -05:00
Louis Dionne
1d57e8669e [std::tuple] Add a test to make sure we workaround libc++ bug 22806 2015-12-21 21:21:37 -05:00
Louis Dionne
af881d3fa2 [Assert] Add xxx_MSG versions of the assertion macros
Fixes #216
2015-12-18 15:04:20 -05:00
Louis Dionne
a723f28650 [detail] Support __VA_ARGS__ in PP_STRINGIZE 2015-12-18 14:17:26 -05:00
Louis Dionne
b55260b3f4 [if_] Fix lifetime issue introduced in d93a7c8 2015-12-17 08:40:22 -05:00
Louis Dionne
d93a7c81c3 [if_] Hold branches by reference instead of moving them in 2015-12-16 14:06:55 -05:00
Louis Dionne
401204d238 [experimental] Remove unused experiment with fold expressions 2015-12-16 14:06:55 -05:00
Jason Rice
35449972d3 [bug] convert predicate results to bool
[ldionne: Minor reformatting (add spaces after //)]

Fixes #221
Closes #222
2015-12-16 11:55:24 -05:00
Louis Dionne
95c8d6ab50 [find_if] Support predicates that return an int.
Fixes #221
2015-12-11 15:57:51 -05:00
Louis Dionne
afe7c52e55 [Printable] Remove misleading constexpr in the documentation 2015-12-11 11:49:04 -05:00
Jason Rice
5c1254f404 [experimental] print_impl for optional
- also added explicit return type for all `print_impl`s
2015-12-10 15:15:23 -08:00
Louis Dionne
850dbf7ad7 Provide an experimental print function
Closes #200
Closes #219
2015-12-09 14:47:13 -05:00
Louis Dionne
75cdd4d4d1 [Doc] Allow breaking MathJax equations on multiple lines
This should fix some issues when looking at the documentation
on small devices.

Also, fix mis-rendered `monadic_compose` in math mode.

Closes #156
2015-12-04 15:19:24 -05:00
Louis Dionne
6bff9f2fc0 [map/set] Document and test the copy/move constructors
Fixes #217
2015-12-04 11:04:04 -05:00
Louis Dionne
baec3a721c Use qualified names for concepts, for consistency 2015-11-29 12:11:54 -05:00
Louis Dionne
fef6023530 [optional] Reword the documentation for constructors and assignments
Fixes #190
2015-11-26 18:00:02 -05:00
Louis Dionne
3316aed8a8 [Config] Adjust warning messages when detecting compilers 2015-11-25 12:29:54 -05:00
Louis Dionne
f41abafb13 [tag_of] Require idempotence
Also, fix Doxygen warning in core/convert.hpp.

Closes #212
2015-11-21 15:19:40 -05:00
badair
87f82e9003 [feature] [UDL] adding UDL logic for hex, binary, octal
[ldionne:
Remove rogue whitespace at the end of lines

Closes #210]
2015-11-20 08:52:55 -05:00
Louis Dionne
8bf53a367e Bump version to 0.7.0 2015-11-19 14:41:03 -05:00
Louis Dionne
e213a0b283 [to] Define to_t in the forward header 2015-11-17 16:27:48 -05:00
Louis Dionne
7103b41775 [to_xxx] Move to fwd headers 2015-11-17 09:41:07 -05:00
Louis Dionne
56d4c499ad Use a macro to open and close Hana's namespace
Note, however, that we're not using inline namespaces yet.
Using a macro to open/close the namespace would however make
such a change trivial.
2015-11-17 09:33:21 -05:00
badair
197c152495 [to_xxx] [convert] adding to<xxx> equivalents
- adding to_map
- adding to_set
- adding to_tuple

ldionne:
    Closes #206
    Closes #164
2015-11-16 20:18:08 -05:00
Louis Dionne
a41f63693b [Tutorial] Complete the section on external adapters 2015-11-15 15:16:31 -05:00
Louis Dionne
2a0bf6b34f [std::ratio] Add documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
b906aeb277 [std::pair] Add documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
d54fb5fa32 [boost::tuple] Add documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
735fc4e628 [std::tuple] Add documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
371c07e62d [std::integral_constant] Add documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
11a7300651 [Fusion] Document adapters 2015-11-15 15:16:31 -05:00
Louis Dionne
f307d74daa [mpl::list] Refactor the reference documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
771f822458 [Doc] Minor stylistic improvements 2015-11-15 15:16:31 -05:00
Louis Dionne
e93de9580c [mpl::integral_c] Refactor the documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
b86580c593 [mpl::vector] Refactor the reference documentation 2015-11-15 15:16:31 -05:00
Louis Dionne
184bdad14a [std::integer_sequence] Document and add examples 2015-11-15 15:16:30 -05:00
Louis Dionne
11096eb1d0 [std::array] Document properly and add examples 2015-11-15 15:16:30 -05:00
Louis Dionne
61b3ab74dc [Doc] Prepare the setup to document external adapters. 2015-11-15 15:16:30 -05:00
m-j-w
87c036bc64 [Clang-cl] Compiler detection for LLVM/Clang-cl with Visual Studio integration
[ldionne: Minor reindentation, add space between < operator]

Closes #203
2015-11-15 15:15:12 -05:00
Louis Dionne
5a461a40ac [adjust_if] Minor improvement in the implementation 2015-11-14 10:37:56 -05:00
Louis Dionne
8ff5987200 [equal] Minor improvement in struct comparison 2015-11-14 10:28:40 -05:00
Louis Dionne
b5e82061d8 Provide macros to detect the version of the library
Closes #189
2015-11-13 14:25:33 -05:00
Louis Dionne
537e4fe645 [Detail] Avoid EBO-disabling duplicate base classes caused by operators::adl
Fixes #202
2015-11-13 12:23:06 -05:00
Louis Dionne
e77801512e [Doc] Fix the name of BOOST_MPL_MAX_XXX_SIZE, and add links 2015-11-12 14:33:54 -05:00
Louis Dionne
e13d826496 [MPL] Add support for mpl::list 2015-11-12 14:23:15 -05:00
Louis Dionne
cb390d2c82 [Detail] Use qualified calls in detail/algorithm.hpp 2015-11-11 16:38:10 -05:00
Louis Dionne
3707877225 [Iterable] Remove the tail function
Closes #158
2015-11-11 14:08:36 -05:00
Louis Dionne
7d578de9d8 [Iterable] Reformulate the MCD in terms of drop_front 2015-11-07 16:18:11 -05:00
Louis Dionne
0fb43a90ed [Fusion] Fix bug in tail(fusion::deque) 2015-11-07 12:06:02 -05:00
Louis Dionne
2e0df33d8e [Iterable] Optimize the default implementation of drop_front_exactly 2015-11-06 13:04:23 -05:00
Louis Dionne
f1090d517f [Map] Take by const& instead of by value in any_of 2015-11-03 10:57:33 -05:00
Louis Dionne
cb411673d2 [Struct doc] Fix misformatting of refined concepts 2015-10-27 10:30:16 -04:00
Louis Dionne
58df94c84c [Doc] Add a link to eval_if from the documentation of eval.
Fixes #146
2015-10-27 08:52:56 -04:00
Louis Dionne
b0f8cf2bf1 [Doc] Add links to functional programming concepts
Closes #134
2015-10-22 17:59:03 -04:00
Louis Dionne
dbd0fb9246 Change links from ldionne/hana to boostorg/hana 2015-10-19 09:41:47 -04:00
Louis Dionne
8a643a9c14 [optional] Make the interface closer to that of std::optional
Also remove `only_when`, which is frankly not very useful.
2015-10-12 11:29:37 -04:00
Louis Dionne
6ce5826b75 [Struct] Return a reference from at_key
Partially addresses #90
2015-10-12 10:45:49 -04:00
Louis Dionne
35da925d19 [IntegralDomain] Rename to EuclideanRing
Note that no `norm` function is added for now, since the `norm` is not
tied to the specific Euclidean ring as explained in [1]. However, it
might be useful to enforce an arbitrary choice to be made for each
Euclidean ring. This could perhaps be added in the future.

Fixes #28

[1]: https://en.wikipedia.org/wiki/Euclidean_domain#Definition
2015-10-08 14:42:22 -04:00
Louis Dionne
bd974d6ad8 [capture] Clarify the documentation, and explain difference with partial
Fixes #183
2015-10-03 20:25:10 -04:00
Louis Dionne
c15822e93b [filter] Use unpack in the implementation for Sequences 2015-10-03 20:25:10 -04:00
Louis Dionne
d6acfe4164 Add detail::decay, a faster equivalent to std::decay 2015-09-30 15:40:41 -04:00
Louis Dionne
42934900b8 [Struct] Add the BOOST_HANA_ADAPT_ADT macro
Also
- Reorganize adaptation macro unit tests
- Add BOOST_HANA_PP_DROP_FRONT and BOOST_HANA_PP_FRONT macros
2015-09-22 13:37:49 -07:00
Louis Dionne
df7bdf5c69 [functional/apply] Behave like C++17's std::invoke 2015-09-22 10:40:23 -07:00
Louis Dionne
989d5f3f0a [map] Return a reference from at_key
Addresses this StackOverflow question: http://stackoverflow.com/q/32702383/627587
And also partially addresses #90.
2015-09-22 10:40:23 -07:00
Louis Dionne
403afe2dc9 [folds] Fix bugs in folds when taking state by reference
Partially addresses this SO question: http://stackoverflow.com/q/32702383/627587
2015-09-22 10:40:23 -07:00
Louis Dionne
5dd8a4c645 [Struct] Improve documentation about alternate interface for accessors
Addresses http://stackoverflow.com/q/32678647/627587
2015-09-21 23:54:22 -07:00
Louis Dionne
cf063a4fe3 Return hana::integral_constants from type_traits adapters
Also, remove the ext/std/{type_traits,utility} headers in favour of the
<boost/hana/traits.hpp> header.
2015-09-21 07:45:04 -07:00
Louis Dionne
01085771f2 [Doc] Minor fixes in Sequence and MonadPlus
- MonadPlus: "Second" -> "Secondly"
- Sequence: Fix malformatted list of provided models
2015-09-20 09:24:19 -07:00
Louis Dionne
54a03c1998 [Doc] Fix broken links to insert, erase_key and keys 2015-09-15 10:30:03 -04:00
Louis Dionne
6777caade1 [map] Optimize the insert method, which had bad runtime performance 2015-09-15 10:04:06 -04:00
Louis Dionne
41c64b39a9 [IntegralDomain] Rename quot/rem to div/mod
Fixes #180
2015-09-14 14:18:29 -04:00
Louis Dionne
41c621ba0f [Config] Define BOOST_HANA_CONFIG_LIBSTDCXX when the stdlib is libstdc++ 2015-09-13 16:10:05 -04:00
Louis Dionne
cb2badbc88 [detail/by] Rename detail::by to detail::nested_by for consistency 2015-09-13 10:52:08 -04:00
Louis Dionne
3fdfc475a1 [detail] Remove now unused generate_integer_sequence 2015-09-13 10:52:08 -04:00
Louis Dionne
267cef77e1 [Doc] Remove Doxygen warnings and make it more quiet 2015-09-12 23:54:37 -04:00
Louis Dionne
1d7b720c95 [Enumerable] Remove that concept entirely.
Enumerable was not being used inside the library, and its usefulness
was questionable due to the lack of upper/lower bounds.

Closes #23
2015-09-12 17:59:58 -04:00
Louis Dionne
272e583ce5 [tuple] Optimize find_if and do minor refactoring 2015-09-12 15:07:52 -04:00
Louis Dionne
ca2d5a69c5 [Config] Remove xxx_CONSTEXPR_MEMBER_FUNCTION_IS_CONST macro
This macro was only relevant on GCC 4.9, but we're not supporting
it anyway.
2015-09-11 12:40:14 -04:00
Louis Dionne
f74cfba590 [functional/partial] Workaround bug in libstdc++ tuple 2015-09-11 12:40:14 -04:00
Louis Dionne
8e80aff466 [detail] Remove now obsolete variadic::for_each 2015-09-09 19:58:40 -04:00
Louis Dionne
049f8e1dd7 [unpack] Show the right benchmark in the docs (was showing transform's)
Also, sample every 2 increments, otherwise the graph is undreadable
2015-09-09 19:33:19 -04:00
Louis Dionne
eeb856a243 [detail/operators] Move the hana::operators to detail
Makes it clear that this is an implementation detail only. Also, slightly
improve the documentation of operators::adl.

Fixes #178
2015-09-09 18:32:32 -04:00
Louis Dionne
c32ec8c3d0 Reformulate many algorithms in terms of IntegralConstants instead of Constants 2015-09-09 15:55:18 -04:00
Louis Dionne
136ba9be56 [IntegralConstant] Add the repeat algorithm
Fixes #100
2015-09-09 15:37:31 -04:00
Louis Dionne
8b1b9ce0e6 Add the IntegralConstant concept
Also, make existing Constants models of IntegralConstant. This fixes #132
by making the definition of a model of Constant reasonably easy for
IntegralConstants.
2015-09-09 15:36:53 -04:00
Louis Dionne
da0a8281d1 Replace decltype(xxx_c) patterns by their actual types 2015-09-09 15:26:19 -04:00
Louis Dionne
cb43a2f7b2 [Doc] Minor fixes
- Do not strip comments from the documentation
- Mention `to` in the MCD of Constant
2015-09-09 15:25:50 -04:00
Louis Dionne
a7f25d124e [slice] Accept an arbitrary Foldable of indices, and remove subsequence
Fixes #84
2015-09-08 17:29:54 -04:00
Louis Dionne
5d02750150 Improve diagnostics for supported compilers and standard libraries
Closes #172
Closes #168
2015-09-08 08:25:07 -04:00
Louis Dionne
423bc7220a [MonadPlus] Rename repeat to replicate 2015-09-07 22:43:35 -04:00
Louis Dionne
35c8d59074 Remove detail::closure, now replaced by basic_tuple 2015-09-07 16:32:14 -04:00
Louis Dionne
37dc041af5 [Functional][lazy] Use basic_tuple instead of closure<>
Also, modularize and refactor some unit tests for Functional utilities.
2015-09-07 16:31:23 -04:00
Louis Dionne
ef3d46e8aa [hana::pair] Document the constructors and add unit tests 2015-09-07 14:28:35 -04:00