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

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.
This commit is contained in:
Antony Polukhin
2025-04-16 09:16:09 +03:00
committed by GitHub
parent 3fe5ce61ee
commit 5a48d7456f
52 changed files with 321 additions and 193 deletions

View File

@@ -39,9 +39,7 @@ PROLOGUE = """// Copyright (c) 2016-2025 Antony Polukhin
#include <boost/pfr/detail/sequence_tuple.hpp>
#include <boost/pfr/detail/size_t_.hpp>
#ifdef BOOST_PFR_HAS_STD_MODULE
import std;
#else
#if !defined(BOOST_PFR_INTERFACE_UNIT)
#include <type_traits> // for std::conditional_t, std::is_reference
#endif