1493 Commits

Author SHA1 Message Date
085c27f785 Merge pull request #198 from boostorg/pr181
Integrate PR181
2025-04-21 15:19:26 +01:00
5329d1d497 Disable constexpr test in C++03. 2025-04-21 13:40:42 +01:00
4126ca650c integral_constant: As per std: Add operator().
In the C++ Standard Library, `std::integral_constant` has `operator()`:

https://timsong-cpp.github.io/cppwp/meta.help

We hereby add `operator()` for the Boost version.
2025-04-21 12:26:41 +01:00
f31a9da4d8 integral_constant: As per std: Mark operator T as noexcept.
In the C++ Standard Library, `std::integral_constant`
has its `operator T` marked as `noexcept`:

https://timsong-cpp.github.io/cppwp/meta.help

We hereby do the same for the Boost version.
2025-04-21 12:26:40 +01:00
ff0ae13c64 integral_constant: MPL interop: Avoid one function-local static object.
If the compiler does not optimize away the `pdata` function-local `static` object,
it ends up occupying space in the data section
and it is going to need a corresponding relocation entry
(just in case the module is not loaded at the desired address,
as is the case with ASLR in Windows Vista and later and in modern versions of Linux).

I admit that, for the current code,
both MSVC and GCC manage to optimize away `pdata` even if it is `static`.

But Boost should be an example of good coding
which can be applied even to more complicated source code,
e.g. to source code which calls `opaque_function (&pdata)`
(in which case, if `pdata` is static, both MSVC and GCC do emit an extra relocation).

And for other more complex cases, a function-local static-storage-duration object
costs even more (as compared to a function-local automatic-storage-duration object
given C++11 rules for "thread-safe" initialization of function-local `static`s.

And I wish to re-iterate that, in my opinion,
a good way to cast a pointer-to-one-type to a pointer-to-an-unrelated-type
is not by `reinterpret_cast` (which by the way makes `pdata` not needed any more),
but by using pointer to (possibly cv-qualified) `void` as an intermediary pointer type:

```
return static_cast <const Target *> (static_cast <const void *> (pointer_to_source))
```

or:

```
const void *const intermediary (pointer_to_source); // Not `static` for the general case.
return static_cast <const Target *> (intermediary);
```

Therefore, if the authors kindly agree, we can make this code an example for this style.
2025-04-21 12:26:39 +01:00
0422aebeb8 integral_constant: MPL interop: Avoid reinterpret_cast.
Conversion between pointers to unrelated types `Source` and `Target`
can be done with two `static_cast`'s
("upcast" to pointer to cv-void followed by "downcast")
 => (IMO) it should be done with `static_cast`
(in order not to give the impression that `reinterpret_cast` really is needed):

  `T *ptr_target = static_cast <T *> (static_cast <void *> (ptr_source));`

(Maybe that was the original intent of introducing `pdata`.)
2025-04-21 12:26:39 +01:00
4824c0fae4 Merge pull request #180 from Lastique/feature/better_fallback_is_complete
Make fallback `is_complete` implementation more robust
2025-04-21 12:16:06 +01:00
14560070ca Make fallback is_complete implementation more robust.
When all else fails, at least indicate the types that we always know to
be incomplete: cv void and boundless arrays.

Also cleanup formatting a bit.
2025-04-21 11:45:34 +03:00
448ac57c32 Merge pull request #197 from boostorg/ci_update
Streamline and update CI
2025-04-17 18:37:35 +01:00
d3be907a0e Update linux image, use GCC-14 as well. 2025-04-17 16:50:47 +01:00
0098628ffc Correct drone script #2. 2025-04-16 19:23:22 +01:00
22fc23db2a Use depinst tool to handle dependencies in drone. 2025-04-16 18:06:07 +01:00
f0bc869030 Update clang versions. 2025-04-16 17:10:37 +01:00
aabf3afcb2 Streamline and update CI 2025-04-15 18:41:23 +01:00
ba238b7206 Merge pull request #195 from grafikrobot/modular
Add support for modular build structure.
2024-08-19 09:22:11 +01:00
ba180333de Adjust doc build to avoid boost-root references. 2024-07-28 16:38:50 -05:00
4b3480740c Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:23 -05:00
8558d7f831 Update copyright dates. 2024-07-20 22:52:04 -05:00
d2f66abb22 Change all <source> references to <library>. 2024-07-20 21:27:13 -05:00
47e22e7887 Bump B2 require to 5.2 2024-06-14 11:33:56 -05:00
56ffb88963 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
280b90422d Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:16:00 -05:00
fc1decfa08 Make the library modular usable. 2024-03-11 08:38:17 -05:00
821c53c0b4 Add support for C++23 <stdfloat> types. (#183)
* Add support for C++23 <stdfloat> types.

* Update CI scripts.
* Update C++20 testing in has_right_shift_test.cpp.
2023-10-15 16:36:16 +01:00
1ebd31e60e Remove redundant CI test. 2023-02-23 18:23:02 +00:00
155cb2e47c Merge pull request #178 from Lastique/feature/is_swappable
Add `is swappable` trait.
2023-02-23 18:20:08 +00:00
5f43b22861 Reuse is_swappable implementation in is_nothrow_swappable for gcc < 4.7.
This avoids applying noexcept operator to a potentially invalid
swap expression, which should resolve ICE with gcc 4.6.
2023-02-19 16:22:48 +03:00
fc61f298bf Added is_swappable(_with) traits. 2023-02-19 16:22:41 +03:00
1c31fee575 Extracted C++11 implementation of is_nothrow_swappable to a separate header.
Also modified the implementation to avoid referencing any potential swap
overloads in namespace boost, unless these overloads are found by ADL.

Added tests to verify is_nothrow_swappable works with ADL.
2023-02-18 23:53:35 +03:00
2370288a79 Update operators docs.
Fixes https://github.com/boostorg/type_traits/issues/160.
2022-11-21 18:24:04 +00:00
6ffc0e5ebd Merge pull request #176 from boostorg/pr/char8_t-is-integral
Specialize boost::is_integral for char8_t when available. Fixes #175.
2022-11-06 18:37:51 +00:00
f753087cd0 Specialize boost::is_integral for char8_t when available. Fixes #175. 2022-10-30 03:45:54 +03:00
990166cd59 Merge pull request #174 from ecatmur/clang-15-intrinsics
Replace clang 15 deprecated intrinsics
boost-1.81.0.beta1
2022-09-13 12:08:26 +01:00
e1d0699a82 Move test for __has_builtin to enclosing #if
Clang has __has_builtin since at least version 3
2022-09-12 12:29:09 +01:00
a1d0b207c5 Replace deprecated intrinsics
https://github.com/boostorg/type_traits/issues/173
2022-09-06 20:05:36 +01:00
fdef681a84 Merge pull request #172 from Flamefire/wundef
Make build `-Wundef` clean
2022-07-07 11:17:26 +01:00
d71524a799 Make build -Wundef clean
Use `#ifdef __cpp_noexcept_function_type` instead of
`#if __cpp_noexcept_function_type` to avoid `-Wundef` warnings.
Also add that flag to the test flags to detect those on CI.
2022-07-07 10:05:05 +02:00
d2a4a6bf0a Merge pull request #167 from boostorg/msvc2022_ci
Correct CI workflow and add 2022 tests.
boost-1.79.0 boost-1.80.0.beta1 boost-1.80.0 boost-1.79.0.beta1
2022-02-11 09:56:38 +00:00
273678042d Correct CI workflow and add 2022 tests. 2022-02-10 18:06:40 +00:00
bc26f6b192 Merge pull request #157 from eldiener/develop
[skip ci] Fixed operator traits example code for last issue.
2022-02-10 13:12:02 +00:00
a10ca89479 Merge pull request #163 from igaztanaga/patch-1
Fix -Wconversion warning for GCC / 64 bits
2022-02-10 13:10:42 +00:00
a184e146e3 Merge pull request #161 from boostorg/pr/tt-has-accurate-function
Fix misspelled macro name
2022-02-10 13:10:02 +00:00
8583d1a967 Fix -Wconversion warning for GCC / 64 bits
../../boost/type_traits/is_complete.hpp:47:14: error: conversion from ‘long unsigned int’ to ‘unsigned int’ may change value 
       ok_tag<sizeof(T)> check_is_complete(int);
2021-12-30 15:29:17 +01:00
b265ce8f3a Merge branch 'develop' of https://github.com/boostorg/type_traits into develop 2021-10-06 08:56:09 +01:00
e3dd034588 Remove obsolete test runner Xenial. 2021-10-06 08:55:49 +01:00
d37dc8c4b9 Merge pull request #162 from boostorg/test_on_cuda
Initial CUDA testing.
2021-10-06 08:18:21 +01:00
7ac69733b8 Update CI scripts for testing with CUDA device compile.
Fix inspection report issues.
2021-10-03 12:20:08 +01:00
18b6e30e9c Fix up CUDA device testing [CI SKIP] 2021-10-03 12:09:10 +01:00
09b102587f Misc CUDA testing fixes 2021-10-02 15:13:42 +01:00
a842eeda5c Initial CUDA testing. 2021-10-01 19:10:34 +01:00