Commit Graph

1208 Commits

Author SHA1 Message Date
Quentin Chateau
1f4157503b [sort] implemented as merge sort
replaced the insersion sort by a merge sort
reduces compilation time, memory usage and
template recursion depth
2019-09-24 06:47:22 -06:00
Louis Dionne
83cc1cc53e [config] Remove warnings in config.hpp for unsupported compilers
As we bump the compiler requirements, it becomes unreasonable to issue
a warning for compilers that might work with Hana, but that are not
officially supported.
2019-07-30 14:48:41 -04:00
Louis Dionne
8f935a710b [config] Remove Standard Library detection
In most cases, this shouldn't be necessary if we detect the compiler
being used. Strictly speaking, this isn't true because someone could
override the Standard Library with any compiler. However, the logic
for detecting the Standard Library is broken for recent libc++'s, and
I don't want to maintain that.

Also, the Standard Libraries that are not supported are getting more
and more ancient, so the benefit of having these warnings in place is
getting smaller and smaller.
2019-07-30 14:48:41 -04:00
Louis Dionne
99649ba5ed Remove workaround for libc++ bug 22806
This is the only workaround that uses BOOST_HANA_CONFIG_LIBCPP, and I'd
like to get rid of all standard library detection.
2019-07-30 14:48:41 -04:00
Louis Dionne
9fdce75e71 [doc] Fix Doxygen warnings and errors with recent Doxygens 2019-07-29 10:23:55 -04:00
Louis Dionne
48eb17e0bf [curry] Use anonymous namespace instead of 'static'
Apparently, 'static' can't be used on explicit instantiations of
variable templates (or so GCC says).
2019-07-29 10:23:55 -04:00
Louis Dionne
7218a046c7 Fix duplicate symbol error
Explicit instantiations of const variables templates are not given
internal linkage by default, so defining curry_or_call<0> was an
ODR violation (a global defined in all TUs where it's included).

In LLVM parlance, we could either give it linkonce_odr semantics
(with C++17 inline variables) or give it internal linkage. Since
Hana is a C++14 library and I don't think there will be any code
bloat associated to this, I'm going with internal linkage.

Fixes #446
2019-07-29 10:23:55 -04:00
Louis Dionne
3c660c1e9d Remove unnecessary ref-qualifiers in static_cast
In that context, `decltype(f)` and `decltype(f)&&` are always the same
thing.
2019-04-22 10:47:27 -04:00
Louis Dionne
97a77f5063 Bump compiler requirements 2019-04-22 10:47:27 -04:00
Tinko Bartels
9ffeb079fe [doc] fixed links that were broken by a page move at cppreference. 2019-04-22 10:43:21 -04:00
Louis Dionne
a931d11241 [version] Bump to 1.6.0, the next planned release 2019-02-11 16:37:58 -05:00
Xiang Fan
9b808523ff Update the status of 'BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735' 2018-08-22 17:00:13 -07:00
Xiang Fan
5d38f120fa Address review feedback.
1. Apply workaround 'BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568' unconditionally

2. Fix indentation of #if/#endif
2018-08-22 16:59:56 -07:00
Xiang Fan
95f8f74a2c Enable building boost.hana with VS2107 15.8 (with five source workarounds)
Here is the test result:

 100% tests passed, 0 tests failed out of 1103

Here are the details of the source workarounds:

 1. Active issues we are working on
 a. Multiple copy/move ctors
 VC doesn't correctly handle multiple copy/move ctors.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_MULTIPLECTOR_106654.

 b. Forward declaration of class template member function returning decltype(auto) (this issue is exposed by a recent change in boost 1.68)
 To deduce the actual return type, the compiler expects the function definition to be on the pending list for temploid, which isn't always the case when generic lambda is involved.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735

 2. Issues fixed in the development branch of MSVC
 Parsing template id
 VC sometimes incorrectly parses a comparison operation as a template id.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568.

 3. Issues fixed conditionally
 a. Empty base optimization
 VC doesn't always do EBO (empty base optimization). Changing this will break the ABI of MSVC and we provide a __declspec(empty_bases) to enable EBO.
 We have a blog post on this: https://blogs.msdn.microsoft.com/vcblog/2016/03/30/optimizing-the-layout-of-empty-base-classes-in-vs2015-update-2-3/.
 Some tests in hana have static_assert on the size of certain types which relies on EBO being applied:

 hana\test\detail\ebo.cpp
 hana\test\issues\github_202.cpp
 hana\test\pair\empty_storage.cpp
 hana\test\tuple\empty_member.cpp

 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_EMPTYBASE.

 b. Variadic macro expansion
 The implementation of variadic macro isn't conformant and the macro expansion often results in incorrect result.
 The issue is fixed under /experimental:preprocessor and isn't on by default yet.
 We have a blog post on this: https://blogs.msdn.microsoft.com/vcblog/2018/07/06/msvc-preprocessor-progress-towards-conformance/.

 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033.

Here is the list of files impacted by the source workarounds:

 BOOST_HANA_WORKAROUND_MSVC_MULTIPLECTOR_106654
  hana\test\_include\laws\base.hpp
  hana\test\map\cnstr.trap.cpp
  hana\test\set\cnstr.trap.cpp
  hana\test\tuple\cnstr.trap.cpp

 BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735
  hana\test\_include\laws\euclidean_ring.hpp
  hana\test\_include\laws\group.hpp
  hana\test\_include\laws\monad_plus.hpp
  hana\test\_include\laws\monoid.hpp
  hana\test\_include\laws\ring.hpp

 BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568
  hana\include\boost\hana\basic_tuple.hpp
  hana\include\boost\hana\string.hpp
  hana\include\boost\hana\tuple.hpp

 BOOST_HANA_WORKAROUND_MSVC_EMPTYBASE
  hana\include\boost\hana\basic_tuple.hpp
  hana\include\boost\hana\pair.hpp
  hana\include\boost\hana\tuple.hpp
  hana\include\boost\hana\detail\integral_constant.hpp
  hana\test\detail\ebo.cpp

 BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033
  hana\include\boost\hana\detail\preprocessor.hpp
  hana\include\boost\hana\detail\struct_macros.hpp

BTW,
1. There are some warnings which I don't fix. I will likely address them in a separate PR. They look legit and don't impact the build and tests.
2. Appveyor currently doesn't provide 15.8 Preview 5 which contains all the compiler fixes we made in the previous months. I plan to update appveyor.yml after Appveyor provides 15.8 RTM.
2018-08-22 16:59:34 -07:00
Louis Dionne
4baa9069bb [experimental/printable] Mark function as inline
This gets rid of an ODR-violation.

Fixes #417
2018-08-13 11:18:21 -04:00
Louis Dionne
1e1bedb7df Bump version to 1.5.0 2018-07-05 22:48:36 -04:00
Louis Dionne
c334974abe [type] Make metafunction & friends SFINAE friendly
Also add a section to the tutorial showing how to use this functionality.
2018-06-19 21:07:14 -07:00
Jason Rice
56ed55173f [experimental] Printable support for Visual C++
- Fixes printable support for template, metafunction, and metafunction
    in MSVC. Types rendered within are implementation defined.
2018-06-19 20:51:48 -07:00
Louis Dionne
ffba8a9990 [ext.mpl] Support MPL sequences without BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
Fixes #399
2018-06-04 11:33:03 -07:00
Louis Dionne
5af6066e61 Make some containers final and add notes about assumptions about representation
Also, add tests to make sure that an empty pair can be EBO'd. This one is very
important because a typical use case is to create a tuple of pairs of empty
types (e.g. in hana::map), and we expect this to be empty.
2018-05-06 10:08:49 -06:00
Jason Rice
7cd10e98bd More deferring concept checks 2018-04-14 14:25:44 +01:00
Jason Rice
16a7bcda54 [lift] Defer concept check until invocation 2018-04-07 22:33:48 -07:00
Louis Dionne
fd9edff559 [string] Add comment about BOOST_HANA_STRING not being constexpr pre-17
Closes #390
2018-03-05 13:44:05 -08:00
Louis Dionne
bd60612973 Bump version to 1.4.0 2018-02-26 23:01:29 -08:00
Louis Dionne
1970ee95ec [to] Fix ambiguous conversion to the underlying type for integral constants
Fixes #354
2018-02-21 00:55:24 -08:00
Louis Dionne
1aa52a9726 [string] Add a conversion from a Constant holding a char const*
Closes #347
2018-02-21 00:23:17 -08:00
Louis Dionne
b6807015f1 Remove the limitation on the number of members for struct macros
This is done by generating the supporting preprocessor macros with ERB up to
the required arity, like we do for the struct macros themselves.

Fixes #376
2018-02-10 14:20:52 -08:00
Louis Dionne
5e1b6c5039 [ext.std.tuple] Always enable the adapter, even on older libc++'s
This used to guard against a bug in the std::tuple implementation, but it
seems like this bug was fixed in subsequent minor releases of Clang 3.5 and
3.6, which we test against.
2017-11-26 14:18:08 -08:00
Louis Dionne
11e3869648 Add take_back_c
This fixes a consistency issue where take_front_c was provided, but take_back_c
was not.

Closes #372
2017-11-25 11:13:48 -08:00
Louis Dionne
b4ad5e1bfa Bump version to 1.3.0 2017-11-11 10:57:26 -07:00
Louis Dionne
9a8081b01f [NFC] Forego implicit conversion in 'index_if' 2017-11-09 10:33:12 -07:00
Louis Dionne
c353ccdd9b [config][assert] Prepare support for constexpr lambdas in C++17
When C++17 is supported, constexpr lambdas can be used and CONSTEXPR_ASSERT
turns into an actual static_assert. This is not unconditionally enabled for
now because Clang does not support constexpr lambdas with captures (!).
2017-07-22 13:13:04 -07:00
Louis Dionne
a7f89f4d39 Mitigate Clang bug with C++1z 2017-07-22 10:12:03 -07:00
Louis Dionne
bb0254dcfb [integral_constant] Handle digit separators in the _c user-defined literal
Closes #362
2017-07-10 10:28:09 -04:00
Louis Dionne
8b1fbe3fff Bump version to 1.2.0 for release 2017-06-27 18:37:42 -07:00
shreyans800755
a88133aa96 [symmetric_difference] Document separately for map and set
Closes https://github.com/boostorg/hana/issues/341
2017-06-19 01:08:35 +05:30
shreyans800755
1e6011d3d7 [difference] Document separately for map and set
Closes https://github.com/boostorg/hana/issues/341
2017-06-19 01:08:35 +05:30
shreyans800755
d70b015cbe [map] Add difference method for map
Closes https://github.com/boostorg/hana/issues/341
2017-06-19 01:08:35 +05:30
shreyans800755
dbf83acdc0 [intersection] Document separately for map and set
Closes https://github.com/boostorg/hana/issues/341
2017-06-19 01:08:34 +05:30
shreyans800755
074a5fa420 [map] Add intersection method for map
Closes https://github.com/boostorg/hana/issues/341
2017-06-19 01:08:34 +05:30
Louis Dionne
283d749dd0 [detail] Silence Doxygen warnings 2017-06-08 21:21:17 -07:00
Louis Dionne
b991b9fc01 [pair] Fix invalid result of ebo_get for nested pairs
Closes #331
2017-06-06 09:50:08 -07:00
Louis Dionne
0f1faa2cd6 [tag_of] Tweak example to avoid triggering GCC bug
This will avoid confusion for users of GCC 6. Reported in #349,
thanks to @Peregring-lk.
2017-05-25 02:21:43 -07:00
Louis Dionne
a80a8222c0 [basic_tuple] Specialize length_impl
This should provide slightly better compile-times, and it removes an old TODO
2017-05-20 21:12:36 -06:00
Louis Dionne
8b2bf22c2d [std.array] Fix UB in std.array.less for empty array
We were using `&arr[0]` on empty arrays, which is technically UB since `arr[0]`
is UB on empty arrays. This triggered an infinite loop on Clang-on-Windows.
2017-05-13 12:59:45 -07:00
Louis Dionne
5637bed9c7 [doc] Fix misformatted Latex signatures
Reported in #340, thanks @viboes
2017-04-26 08:54:26 +01:00
Louis Dionne
33565392ea [union_] Document separately for map and set
Related to #299
2017-04-22 17:22:45 -07:00
shreyans800755
47fe8af1f2 [map] Added union_ method to merge two maps 2017-04-22 16:39:13 -07:00
Louis Dionne
ae2e9664ae [bugfix] Fix incorrect result for first and second in nested pair cases 2017-04-08 14:05:57 -07:00
Louis Dionne
7f87e7ad53 [tuple] Fix misleading comment
[ci skip]
2017-04-08 10:48:58 -07:00