2
0
mirror of https://github.com/boostorg/compat.git synced 2026-01-24 17:52:32 +00:00

168 Commits

Author SHA1 Message Date
Peter Dimov
349fb928b5 Merge pull request #25 from cmazakas/fix/placement-new
Qualify calls to placement new
2026-01-24 12:40:15 +02:00
Christian Mazakas
d6fa246a9c properly qualify calls to placement new
To avoid class-based overload sets for operator new, we qualify our
calls to placement new with `::new` which forces us to pick up the
correct overload when emplacing objects in the small buffer.
2026-01-23 19:38:19 -08:00
Christian Mazakas
008ff1c071 add operator new overloads to test Callables
When Callables are sufficiently small, they're emplaced into a small
buffer directly by placement new. If one, however, uses an unqualified
call to placement new, the class-based overloads are picked up and
compilation fails.

    libs/compat/test/move_only_function_test.cpp:107:11: note: candidate
    function not viable: requires 1 argument, but 2 were provided
        107 |     void* operator new(std::size_t) { throw 1234; }
2026-01-23 19:34:36 -08:00
Peter Dimov
6050e534ca Merge pull request #24 from cmazakas/fix/sbo-invoke-copy
remove copying when invoking objects stored in sbo
2026-01-22 09:49:54 +02:00
Christian Mazakas
4596e8938e initialize object storage using tag dispatch
Currently, the code branches on whether to use SBO or not using a
runtime check, i.e. a raw `if(x)`. This can trick the msvc optimizer
into believing the SBO path can be taken, which in the case of
sufficiently large Callables triggers a buffer overrun warning as
emplacing into the small buffer would exceed its size.

By updating the code to instead dispatch at compile-time via tags, the
msvc optimizer is no longer confused and the warning disappears as the
code path is now truly unreachable.
2026-01-21 19:36:38 -08:00
Peter Dimov
e7098ce569 Bump MSVC < 1950 workarounds to < 1960; still unfixed. Sad! 2026-01-20 18:51:03 +02:00
Peter Dimov
96ec9c1b89 Add msvc-14.5 to .drone.jsonnet 2026-01-20 18:44:56 +02:00
Christian Mazakas
945b2862b4 invoke internal storage via reference
This prevents the code from erroneously copying the storage which causes
surprising behavior as noted here:
https://github.com/boostorg/compat/issues/23
2026-01-20 07:30:53 -08:00
Christian Mazakas
fbad5e0834 add test for in-place mutation of SBO-stored callables 2026-01-20 07:30:25 -08:00
Peter Dimov
7ce75ac955 Update ci.yml 2026-01-16 02:16:52 +02:00
Peter Dimov
0776d62a95 Update documentation boost-1.90.0 2025-11-18 14:33:45 +02:00
Peter Dimov
904b80b8a1 Move nontype.hpp to detail 2025-11-18 14:33:45 +02:00
Peter Dimov
ffaadc079d Update .drone.jsonnet 2025-11-18 12:06:25 +02:00
Peter Dimov
ab09450342 Update documentation of function_ref boost-1.90.0.beta1 2025-11-03 18:54:47 +02:00
Peter Dimov
79ca9646ea Update documentation of nontype to clarify that it requires C++17 2025-11-03 18:41:18 +02:00
Peter Dimov
6b9e52c284 Rename detail::nontype11 to nttp_holder 2025-11-01 19:45:39 +02:00
Peter Dimov
4c9e9079c1 Remove feature check for variable templates; if we have auto template parameters (C++17) we probably have C++14 as well 2025-11-01 19:32:34 +02:00
Peter Dimov
e522245e9c Remove uses of is_rvalue_reference_v 2025-11-01 19:21:51 +02:00
Peter Dimov
cef4d529d0 Remove BOOST_COMPAT_HAS_AUTO_NTTP 2025-11-01 19:16:17 +02:00
Peter Dimov
1e3cb9cc7a Disable tests that require noexcept function types to pass 2025-11-01 19:15:14 +02:00
Peter Dimov
1226bab251 Remove use of BOOST_COMPAT_HAS_AUTO_NTTP in function_ref_mfn_noexcept_test.cpp 2025-11-01 19:00:44 +02:00
Peter Dimov
f9dd6181fb Remove use of BOOST_COMPAT_HAS_AUTO_NTTP in function_ref_mfn_test.cpp 2025-11-01 18:51:37 +02:00
Peter Dimov
db39b5075c Add a C++11 compatible base class to nontype_t; unconditionally enable the function_ref constructors for it 2025-11-01 18:36:05 +02:00
Peter Dimov
f72aeb4e59 Update documentation 2025-11-01 17:57:22 +02:00
Peter Dimov
8e7e16e9c3 Add nontype_test.cpp 2025-11-01 17:18:55 +02:00
Peter Dimov
f897f32064 Extract nontype_t to its own header; add nontype 2025-11-01 17:07:54 +02:00
Peter Dimov
a5a56ee5c0 Merge pull request #22 from k3DW/to_underlying
Add `to_underlying`
2025-09-05 18:48:05 +03:00
Braden Ganetsky
72ff680a72 Fix function signature in to_array docs 2025-09-05 09:33:40 -05:00
Braden Ganetsky
94b1675762 Add to_underlying 2025-09-05 09:33:40 -05:00
Peter Dimov
694b78df7a Update ci.yml 2025-09-04 16:08:07 +03:00
Peter Dimov
e374640265 Remove windows-2019 from ci.yml boost-1.89.0 2025-07-02 19:06:07 +03:00
Christian Mazakas
f496e814b5 update changelog 2025-07-02 07:12:23 -07:00
Peter Dimov
10e1dad9ba Merge pull request #21 from cmazakas/feature/move-only-function
add move_only_function
2025-06-28 17:52:06 +03:00
Christian Mazakas
6172b5e50f add move_only_function docs 2025-06-11 19:57:40 -07:00
Christian Mazakas
1a60e0357c add move_only_function 2025-06-11 19:57:30 -07:00
Christian Mazakas
6901952904 remove ubuntu 20 from posix cmake gha jobs 2025-05-29 15:26:16 -07:00
Christian Mazakas
a1eb40bd0e update gha to use containers 2025-05-29 15:26:16 -07:00
Christian Mazakas
61b464c3ee Merge pull request #17 from cmazakas/fix/lvalue-params
fix lvalue parameter passing
boost-1.88.0.beta1 boost-1.88.0
2024-12-17 12:49:24 -08:00
Christian Mazakas
c3bd40856d remove erroneous rvalue qualification 2024-12-17 11:20:57 -08:00
Christian Mazakas
736b381d13 add failing test case
Passing an lvalue ref parameter when arguments are by-value causes a failure of reference binding.
2024-12-17 11:20:18 -08:00
Peter Dimov
881cc909fb Update .drone.jsonnet 2024-12-13 03:55:39 +02:00
Peter Dimov
c9f3354cff Apply Node20 workaround 2024-12-13 03:34:16 +02:00
Peter Dimov
c4924db9e5 Update ci.yml 2024-12-13 03:21:42 +02:00
Peter Dimov
1a8bb0b574 Update revision history boost-1.87.0 boost-1.87.0.beta1 2024-10-04 13:43:06 +03:00
Peter Dimov
c18e5f2276 Move MSVC workarounds from test/Jamfile to to_array_rvalue_test.cpp 2024-10-04 13:26:50 +03:00
Anarthal (Rubén Pérez)
d2d5cbe094 Added to_array (#14)
* Added to_array

* Suppress unused warnings

* Fix unused warnings (2)

* Workaround msvc 14.0 bug

* Workaround MSVC problems with moving arrays

* MSVC workaround in constexpr test

* Further MSVC fixes

* Disable rvalue tests for MSVC 14.0

* Incorrect argument spec

* constexpr checks

* const test

* Disable rvalues for msvc 14.1

* Docs

* Added more const tests

* Correct static_asserts

* Update type requirements in docs

* Corrected return types and conditions

* Doc updates
2024-10-04 13:06:44 +03:00
Peter Dimov
c49f822b2e Update .drone.jsonnet 2024-08-21 10:49:04 +03:00
Peter Dimov
889d2608e6 Add VERBATIM to add_custom_target 2024-08-20 21:06:26 +03:00
Peter Dimov
787a5dd4d1 Update build.jam 2024-08-20 20:56:20 +03:00
Rene Rivera
a6520ef2e1 Sync from upstream. 2024-07-25 17:20:02 -05:00