Commit Graph

991 Commits

Author SHA1 Message Date
Louis Dionne
a5923b4845 Remove support for Clang 3.5, 3.6, 3.7 and 3.8, and Xcode 8
Those are old compilers and removing support allows removing a couple
of workarounds. It also reduces the CI burden and will allow us to test
more recent and more relevant compilers.
2019-07-30 14:48:41 -04:00
Louis Dionne
aea3a5801c Fix broken cnstr.trap test
A default constructor needs to be define, otherwise Clang emits a
warning that is turned into an error.

Fixes #447
2019-07-29 10:23:55 -04:00
Samuel Debionne
4a5ee58b29 Add a is_valid test for non static member functions 2019-05-10 12:13:37 -06:00
Louis Dionne
a83b844110 [tests] Fix reliance on C++17 behavior for aggregate types
Fixes #429
2019-02-11 16:30:20 -05:00
Louis Dionne
d7efa66130 Remove unused variable warnings with recent Clang 2018-11-09 00:25:30 -08:00
Zach Laine
7adb3f4b31 Rename check to hana_check
If a "check" target exists, give it a dependency on hana_check. Also, add a custom target check that depends on hana_check otherwise.

Closes  (#422)
2018-09-20 14:47:24 -04: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
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
b1c9d2b901 [test.tuple] Remove invalid tests using array smart pointers
Fixes #402
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
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
ba723f7714 Fix broken unit test for struct macros 2018-02-10 16:25:48 -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
cddbcd6d3a [Travis] Add tests on Clang 5.0
Also bump patch-level of Clang 4.0.
2018-01-25 19:46:01 -08:00
Jason Rice
91def72864 [CMake] Specify the toolchain file for the deploy test
Closes pr/toolchain (#382)
2018-01-07 09:26:21 -08:00
Louis Dionne
a525aab0f4 Add tests to make sure that hana::accessors does not decay arrays to pointers
Also, add tests to validate that `hana::tuple` containing an array can't be
constructed from an array, per the standard. Related to #365.
2018-01-01 14:38:18 -08:00
Nikita Kniazev
a6b569b02e Add tests pre-check for B2 2018-01-01 14:37:29 -08:00
Louis Dionne
c92b2d64e1 [tests] Add automatic unit tests for 'ap' 2017-12-01 18:00:49 -08:00
Louis Dionne
a82e0f08c9 [CMake] Specify the generator during the deploy test
This fixes the build on appveyor.
2017-11-26 21:28:45 -08:00
Louis Dionne
8847806d65 [CMake] Add a deployment test that checks the validity of HanaConfig.cmake 2017-11-26 17:50:04 -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
154ddb4f83 [tests] Add missing automatic test cases and get rid of custom tests for Fusion 2017-11-26 14:18:07 -08:00
Louis Dionne
80939d4949 [ext.boost.fusion] Unconditionally enable some Fusion adaptor tests
Those tests were broken with older versions of Boost that we don't test
against anymore. Furthermore, since we document that Boost and standalone
Hana installations should not be mixed, there's no risk of this change
breaking any existing code (that would be mixing standalone Hana with an
old version of Boost).
2017-11-25 13:59:20 -08:00
Louis Dionne
126cdb8e0d [CMake] Make the header tests generate a single executable
The idea was given to me by Daniel Pfeifer (@purpleKarrot), who said it may
actually help find ODR issues better. In any case, this simplifies the script
and reduces the (otherwise overwhelming) number of targets.
2017-11-25 13:00:53 -08: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
e822fd45d9 [NFC] Work around spurious warning in GCC
Bug is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81299
2017-07-03 18:49:05 -07:00
Louis Dionne
d1ea99a84e [CMake] Properly quote file paths 2017-06-24 14:53:10 -07:00
shreyans800755
220017be7f [symmetric_difference] Add tests and example for map
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
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
b991b9fc01 [pair] Fix invalid result of ebo_get for nested pairs
Closes #331
2017-06-06 09:50:08 -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
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
Jason Rice
6d086796a3 [index_if] New index_if function
- Adds index_if
    - Rewrites detail::index_if to use recursive alias stuff
      optimized for tuple and basic_tuple
    - find_if now uses index_if for Iterables
    - at_key now uses index_if for Sequence
    - Removes duplicate code and unnecessary special case implementations
        - detail::advance_until
        - at_key::advance_until
        - tuple_tag implementation of find_if
    - Uses Foldable instead of Sequence for cases where length is known.
      (find_if had a specialization when Iterable and not Sequence)
    - Adds test.*.auto.index_if for Sequences
    - Adds test support/counter for testing infinite iterables
2017-04-07 16:19:52 -07:00
Louis Dionne
ece10d9e9b [CMake] Properly propagate dependencies on Boost headers 2017-03-30 10:25:03 -07:00
Louis Dionne
a0a8ecc061 [CMake] Do not include Boost headers globally 2017-03-29 22:08:04 -07:00
Louis Dionne
bd8bdefa3a [map] Add restricted assignment operators 2017-02-21 23:32:51 -08:00
Louis Dionne
55bb4b9877 [map] Fix overly loose constructors 2017-02-11 15:40:42 -08:00
Louis Dionne
711e6de58a [basic_tuple] Use at_c instead of get_impl to access basic_tuples
This commit decouples the underlying representation of basic_tuple from many
utilities and containers in Hana. This will lead to better support for EBO and
cleaner code, however it might result in a slight compile-time pessimization
since there's one more function instantiation than using `get_impl` directly,
and we're adding 3 overloads to `at_c`.
2017-02-11 15:40:42 -08:00
Louis Dionne
279dbaa9b5 [pair] Ensure that a pair of empty objects is empty too
Also, fix some overly loose constructors
2017-02-11 15:40:42 -08:00
Louis Dionne
40ca5afd7d Add a building block for EBO in containers 2017-02-11 10:26:56 -08:00
Louis Dionne
50336d4aeb [CMake] Use per-target properties instead of populating global flags 2017-02-10 08:07:44 -08:00
Louis Dionne
478b5cc690 [CMake] Handle Valgrind through CTest, without a custom boost_hana_add_test 2017-02-08 07:57:13 -08:00
Louis Dionne
9f18782648 [CMake] Remove nonexistent headers in excluded public header list 2017-02-07 19:30:10 -08:00
Louis Dionne
a39d2fb90c [any_of] Fix a bug where we called the predicate once more than necessary
Also, add automatic unit tests for any_of, all_of and none_of. This commit
also makes it easier to add new automatic unit tests by documenting a small
shell script.

Commit triggered by http://stackoverflow.com/q/42012512/627587
2017-02-03 13:58:08 -08:00
Louis Dionne
620a2f681d [set] Fix broken default constructibility unit test
For some reason, this test failed in Travis when I added it, but the Travis
build still passed so I never noticed it.
2017-01-29 13:06:43 -08:00