2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00
Commit Graph

675 Commits

Author SHA1 Message Date
dependabot[bot]
79a8290374 Bump actions/checkout from 2 to 6 (#226)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-31 14:19:43 +03:00
Antony Polukhin
1b0506f44f Add dependabot 2025-12-24 20:19:28 +03:00
Alexander Grund
7aa41ed4f5 CMake: Condition core_name tests on CMake version (#224)
As those tests require C++20 only compile them with CMake 3.12+ to be able to use `cxx_std_20`
boost-1.90.0.beta1 boost-1.90.0
2025-10-28 19:40:55 +03:00
Alexander Grund
7509049f2c Fix compatibility with CMake < 3.14 (#223)
`NAME_WLE` was introduced in 3.14
2025-10-06 19:38:26 +03:00
Antony Polukhin
4f9e6457b0 Add multiple tests from different bug reports and make sure that ever… (#222)
…ything works with new unsafe_declval and with sturctured binding pack

Fixes: https://github.com/boostorg/pfr/issues/208,  https://github.com/boostorg/pfr/issues/110, https://github.com/boostorg/pfr/issues/126
Closes: https://github.com/boostorg/pfr/pull/212
Relates: https://github.com/boostorg/pfr/issues/173
2025-09-14 14:59:25 +03:00
Antony Polukhin
fc2dba87d6 Multiple fixes for the structured bindings pack implementation (#221) 2025-09-11 21:51:07 +03:00
Antony Polukhin
d9fde1f2a0 core: add an implementation based on C++26 destructuring into a pack (#220)
Tested with clang-21

---------

Co-authored-by: Jean-Michaël Celerier <jeanmichael.celerier@gmail.com>
2025-09-07 20:26:44 +03:00
Antony Polukhin
5034bf55fb Provide and use an alternative implementation of unsafe_declval (#216)
References https://github.com/boostorg/pfr/issues/208
boost-1.89.0
2025-06-27 20:46:59 +03:00
Antony Polukhin
8cbffcb7ab Harden the CI checks for CMake and fix some issues (#215)
Fixes: https://github.com/boostorg/pfr/issues/214
2025-06-27 20:23:23 +03:00
Antony Polukhin
dcf2deb959 Fix for 'Arrays of Length Zero' compiler extension (#213) 2025-06-20 15:56:51 +03:00
Antony Polukhin
2e3663d0df Fix CI tests and docs build (#211)
Fixes https://github.com/boostorg/pfr/issues/203
2025-06-19 18:36:45 +03:00
Antony Polukhin
7259e35f71 Minor fixes for the misc/strip_boost_namespace.sh 2025-06-19 17:23:29 +03:00
Antony Polukhin
f223709e42 Prepare for the 2.3 release of pfr_non_boost version 2025-06-19 17:09:37 +03:00
Antony Polukhin
f61b90ec59 Update regression test links in Readme 2025-06-18 17:51:35 +03:00
Antony Polukhin
820f56c316 Fix typos (#210)
Thanks to https://github.com/TryKuhn for highlighting the issues
2025-06-17 10:39:53 +03:00
Antony Polukhin
9bc3cb2af7 Another fix attempt for the CMake build from the root directory of Boost (#209)
Fixes https://github.com/boostorg/pfr/issues/206
2025-06-17 09:51:17 +03:00
Antony Polukhin
57fa1018b0 Update OSes in CI and run CMake tests (#207)
Fixes https://github.com/boostorg/pfr/issues/205
2025-06-11 21:40:44 +03:00
Antony Polukhin
db9451143a Fix build on standards before C++20 2025-05-12 19:53:03 +03:00
Antony Polukhin
8417d4fd2d Fix test after Boost.TypeIndex modularization 2025-05-12 19:53:03 +03:00
Antony Polukhin
f004e91c9b Return std::array<std::string_view, 0> type for boost::pfr::names_as_array(empty_struct{}) (fixes #195) 2025-05-12 19:53:03 +03:00
Antony Polukhin
b95fd86595 Fix CMake tests build fail (fixes #198) (#201) 2025-05-12 17:28:20 +03:00
Antony Polukhin
3e5c474337 Minor fixes for modules (#200) 2025-04-29 22:04:16 +03:00
Peter Dimov
c902451cc0 Merge pull request #199 from sdarwin/docs
Docs: fix import path
2025-04-23 19:01:15 +03:00
sdarwin
1756327d0a Docs: fix import path 2025-04-18 07:03:07 -06:00
Antony Polukhin
5a48d7456f Rewrite modules following the new recommended Boost practice (#196)
Changes:

1) `#include <boost/pfr...` is now implicitly does `import boost.pfr` if the modules are supported 
2) CI now tests modules on Ubuntu 24.04 with existing runtime tests
3) Renamed module to `boost.pfr`
4) CMakeLists.txt now uses modules for `Boost::pfr` target if modules are supported
5) All the library internals now have unconditional module level linkage. `1)` allows users to mix `#include <boost/pfr...` and `import boost.pfr` in user code without ODR-violations.

Significant differences from https://anarthal.github.io/cppblog/modules3:
* PFR uses a `BOOST_PFR_USE_STD_MODULE` macro for `import std;` / `includes` while building module. This allows to use `boost.pfr` module in C++20 and even without usable  `std` module.
2025-04-16 09:16:09 +03:00
Antony Polukhin
3fe5ce61ee Update copyright years boost-1.88.0.beta1 boost-1.88.0 2025-01-08 20:27:31 +03:00
Antony Polukhin
f09e6aeae9 Fix clang-tidy warnings boost-1.87.0.beta1 boost-1.87.0 2024-10-19 16:25:09 +03:00
Anarthal (Rubén Pérez)
69263f4757 Fix unused warning in fields_count.hpp (#187) 2024-10-15 09:41:21 +03:00
Antony Polukhin
469ac134f3 Micro-optimize PFR fields detection (#188)
* Start upper bound fields search from `4` fields, to avoid slow startup on typical workloads
* Inline the `fields_count_binary_search_unbounded` function to reduce template instantiations depth by 1
* Renamed `min` to `min_of_size_t` to avoid weired syntax
* Applied idea of better error reporting from #120
* Do not start fields count computation if one of the static asserts failed. That speedups error reporting in edge cases
* Use `std::*_t` versions of traits as they are faster in some implementations
* Rewrite binary search to simplify it and to avoid degradation to linear search on types that have constructor from variadic pack
* Remove default template parameters to simplify code

As a result, the whole test suite now runs 10%-25% faster on MSVC, ~20% faster on Clang, and 7%-20% faster on GCC.
2024-10-15 09:39:26 +03:00
Zachary Wassall
ff415a26ff Improve field count typical case performance (#120)
The tightest upper bound one can specify on the number of fields in a
struct is `sizeof(type) * CHAR_BIT`. So this was previously used when
performing a binary search for the field count. This upper bound is
extremely loose when considering a typical large struct, which is more
likely to contain a relatively small number of relatively large fields
rather than the other way around. The binary search range being multiple
orders of magnitude larger than necessary wouldn't have been a
significant issue if each test was cheap, but they're not. Testing a
field count of N costs O(N) memory and time. As a result, the initial
few steps of the binary search may be prohibitively expensive.

The primary optimization introduced by these changes is to use unbounded
binary search, a.k.a. exponential search, instead of the typically
loosely bounded binary search. This produces a tight upper bound (within
2x) on the field count to then perform the binary search with.

As an upside of this change, the compiler-specific limit placed on the
upper bound on the field count to stay within compiler limits could be
removed.
2024-10-09 14:12:39 +03:00
Antony Polukhin
8cd1a9675d Merge branch 'develop' of github.com:boostorg/pfr into develop 2024-09-15 19:35:48 +03:00
Antony Polukhin
4d912c1925 Fix warning about GCC not being aware of the -Wundefined-var-template (fixes #166) 2024-09-15 19:35:21 +03:00
Antony Polukhin
e1a0832a0e Reflect up to 200 fields by default in c++17 implementation via structured bindings (#181) 2024-09-13 19:15:10 +03:00
Anarthal (Rubén Pérez)
73938e0936 Fix unused warnings in core_name14_disabled.hpp (#183)
Fixes #182
2024-09-13 19:03:12 +03:00
Antony Polukhin
e4cbbc78f0 Better headers organization (#180) 2024-09-13 14:24:21 +03:00
Antony Polukhin
6591a8609d Fix pragma directive (fixes #175) 2024-09-13 12:50:43 +03:00
Lena
3d090e7c6f Add function for_each_field_with_name (#171) 2024-09-13 11:57:49 +03:00
René Ferdinand Rivera Morell
e1e908e804 Add support for modular build structure. (#174) 2024-08-24 12:34:29 +03:00
Antony Polukhin
60391652fa Initial support for C++20 modules (#177) 2024-08-15 10:59:07 +03:00
Antony Polukhin
dec9341546 Update ci.yml (#178) 2024-08-14 20:28:49 +03:00
Antony Polukhin
449bf360f7 Workaround MSVC bogus warning (fixes #167) boost-1.86.0.beta1 boost-1.86.0 boost-1.85.0 2024-04-01 12:18:52 +03:00
Denis Mikhailov
5f857d5503 Get rid of cast_to_layout_compatible (#154) boost-1.85.0.beta1 2024-02-17 16:47:03 +03:00
Antony Polukhin
9b90f2f6bb CI fixes (#161) 2024-02-16 08:41:05 +03:00
Antony Polukhin
8f3b819b1e Allow throwing exceptions from pfr::structure_to_tuple (fixes #155) … (#160)
…and fix some warnings
2024-02-15 10:10:46 +03:00
Antony Polukhin
4a973c5eb4 Update docs by not using is_aggregate (fixes #158) and by describing the get_name implementation (fixes #150) 2024-02-14 21:00:23 +03:00
Antony Polukhin
4c15f217f4 Merge pull request #152 from schaumb/get_name
Addressing the limitation of get_name
2024-01-28 11:52:57 +03:00
Antony Polukhin
e969c57be5 Docs update 2024-01-07 13:14:25 +03:00
Antony Polukhin
16d771f498 Update copyright years 2024-01-07 13:12:44 +03:00
bela
16a97bb1f5 Fix sample compilation 2023-11-30 11:41:58 +01:00
bela
8a0447b486 Fix missing ; 2023-11-30 11:31:06 +01:00