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

256 Commits

Author SHA1 Message Date
Antony Polukhin
228922fdb5 Update copyright years 2026-01-04 11:26:11 +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`
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
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
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
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
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 2025-01-08 20:27:31 +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
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
dec9341546 Update ci.yml (#178) 2024-08-14 20:28:49 +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
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
16d771f498 Update copyright years 2024-01-07 13:12:44 +03:00
bela
8a0447b486 Fix missing ; 2023-11-30 11:31:06 +01:00
bela
5b55480c65 Addressing the limitation of get_name 2023-11-30 10:09:09 +01:00
Denis Mikhailov
c695aa0b32 Improve diagnostic for attempt to use get_name with non-external (#146)
Co-authored-by: Antony Polukhin <antoshkka@gmail.com>
2023-11-26 11:52:17 +03:00
denzor200
53fcd78d4f Forbid get_name for arrays 2023-09-23 01:53:00 +03:00
denzor200
833f32960a Fix for printing BOOST_PFR_FUNCTION_SIGNATURE 2023-09-23 01:52:03 +03:00
Antony Polukhin
67f4fc4398 Harden the filed name checks and improve the diagnostics (#138) 2023-09-18 13:57:58 +03:00
Antony Polukhin
9cc76bc277 Suppress non-ASCII warning from boost-inspect 2023-09-17 15:15:40 +03:00
Antony Polukhin
41e87fbadb Do not require Python to run tests 2023-09-17 13:55:47 +03:00
Antony Polukhin
3f07e7187e relax standard library requirements 2023-09-17 13:41:43 +03:00
denzor200
8794056e20 review 2023-09-10 04:06:58 +03:00
denzor200
dd8a5277fb Rename C++20 features detectors 2023-09-09 22:41:10 +03:00
denzor200
dbbfa6ea7f Parser might be explicitly tagged as backward 2023-09-03 02:12:25 +03:00
denzor200
9b2817a52b Parsing ala boost type_index 2023-08-31 02:07:39 +03:00
denzor200
efd25e9968 review 2023-08-27 02:23:54 +03:00
denzor200
a5b9cd567f Add test for big structures 2023-08-26 20:23:50 +03:00
denzor200
6e23ed540f Fix nonascii fields 2023-08-23 01:19:36 +03:00
denzor200
6f544ceaa7 Add Clang support 2023-08-19 19:48:33 +03:00
denzor200
b15196c2e0 Fix MSVC 2023-08-18 02:00:18 +03:00
denzor200
196aeb6da0 Fix lint issue about nonascii symbol 2023-08-12 17:47:58 +00:00
denzor200
fe5a70bac9 Merge remote-tracking branch 'origin/develop' into feature/get_name 2023-08-12 11:59:31 +00:00
Alexander Karatarakis
b5e523f2b3 Make for_each_field() constexpr for c++17 (#134)
#127
2023-08-12 10:43:20 +03:00
Antony Polukhin
e61fa139b6 Add CI tests run on msvc-14.3 in C++20 mode (#136) 2023-08-11 15:05:25 +03:00
denzor200
03e1d768b7 Merge remote-tracking branch 'origin/develop' into feature/get_name 2023-08-11 07:16:16 +00:00
Antony Polukhin
963460a3c1 fix CI (#135) 2023-08-10 17:22:31 +03:00
denzor200
454947de51 review 2023-06-28 12:32:26 +00:00
denzor200
f09357c1bf fix lint issues 2023-06-27 13:10:57 +00:00