Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2eb3cdb
Initial implementation
anarthal Dec 22, 2024
9b7ff23
type_name
anarthal Dec 22, 2024
a3620aa
Sanitize lwt_unattend.hpp
anarthal Dec 22, 2024
1d7cf33
lightweight_test_trait
anarthal Dec 22, 2024
237a580
Export is_same
anarthal Dec 22, 2024
e787de0
CMake helper function
anarthal Dec 22, 2024
4f27a9b
Add __scope to reduce duplication
anarthal Dec 22, 2024
4e3540a
Rename module to boost_xxx.cpppm
anarthal Dec 30, 2024
14253cb
BASE_DIRS
anarthal Dec 30, 2024
232d0b0
extern C++
anarthal Dec 30, 2024
8d9426a
Rename config macro to BOOST_USE_MODULES
anarthal Dec 30, 2024
f9ef824
Modularized bit
anarthal Dec 30, 2024
79c8104
Modularize enable_if
anarthal Dec 30, 2024
7679402
Modularize string_view
anarthal Dec 30, 2024
a33ad24
Added detail/splitmix64
anarthal Dec 31, 2024
465a09e
Fixed incorrect include in lightweight_test_trait.hpp
anarthal Jan 1, 2025
ff8719a
Move away from BOOST_MODULE_EXPORT
anarthal Jan 3, 2025
b59969c
lightweight test copyrights
anarthal Jan 3, 2025
219096d
Move away from CMake common function
anarthal Jan 10, 2025
1586f4a
Initial implementation of compatibility headers
anarthal Jan 14, 2025
5cd685f
Make core compatibility headers
anarthal Jan 14, 2025
f7395bf
import std in lightweight test headers
anarthal Jan 15, 2025
3a6bf2b
Merge develop
anarthal Jan 30, 2026
a8b4fa8
Missing file
anarthal Jan 30, 2026
fc81b3a
Post-merge fixes
anarthal Jan 30, 2026
2b1945d
add missing export
fdr400 Feb 1, 2026
1e08caa
Merge pull request #1 from fdr400/feature/cxx20-modules
anarthal Feb 2, 2026
b353b8b
Boost.ThrowException is now header
anarthal Feb 25, 2026
916af76
Reorder
anarthal Feb 26, 2026
2896671
Warning suppression to cpp
anarthal Feb 26, 2026
4d1582a
Intrin wrapper
anarthal Feb 26, 2026
bedfa54
Use the intrin wrapper
anarthal Feb 26, 2026
ece6ab8
Sanitize bit includes
anarthal Feb 26, 2026
6f134a1
whitespace
anarthal Feb 26, 2026
79d4281
proper demangle handling
anarthal Feb 26, 2026
9fc0397
demangle final fixes
anarthal Feb 26, 2026
3ddc7a1
restore enable_if
anarthal Feb 26, 2026
db4ee91
lwt test 1
anarthal Feb 26, 2026
02608c8
lightweight_test
anarthal Feb 26, 2026
afdf6ff
lightweight_test_trait
anarthal Feb 26, 2026
bf4552e
type_name
anarthal Feb 26, 2026
8a8eaa0
is_same
anarthal Feb 26, 2026
620695c
lwt_unattend
anarthal Feb 26, 2026
880ec9e
splitmix64
anarthal Feb 26, 2026
3c1540c
remove crtdbg wrapper
anarthal Feb 26, 2026
4a9430d
string_view
anarthal Feb 26, 2026
14a8749
lwt fixes
anarthal Feb 26, 2026
8058ab5
boost_core cleanup
anarthal Feb 26, 2026
f8bc508
ABI breaking
anarthal Feb 26, 2026
f68b9f9
Whole-lib modularization
anarthal Feb 26, 2026
1d7f35c
clang fixes
anarthal Feb 26, 2026
e90df1a
Missing exports
anarthal Feb 26, 2026
06eed22
More missing exports
anarthal Feb 26, 2026
7a8c016
Test initial impl
anarthal Feb 26, 2026
39a6516
Missing small headers
anarthal Feb 26, 2026
bd1c99f
move header
anarthal Feb 26, 2026
b0aa468
proper get_pointer
anarthal Feb 26, 2026
aa457f8
missing includes
anarthal Feb 26, 2026
f53b4a0
gcc fixes
anarthal Feb 26, 2026
0e0ec8f
CI
anarthal Mar 5, 2026
5a68903
Fix lightweight_test header status
anarthal Mar 5, 2026
2ab4253
no newline
anarthal Mar 5, 2026
fb31ce7
Python 2.7 compatibility
anarthal Mar 5, 2026
525dbcf
Update cmake test versions
anarthal Mar 6, 2026
e78d7b9
CI cleanup
anarthal Mar 6, 2026
23eda86
export import std
anarthal Mar 6, 2026
50e14cc
set CMAKE_C_COMPILER
anarthal Mar 6, 2026
fea1559
fix appveyor
anarthal Mar 6, 2026
adbdf88
-DCMAKE_CXX_MODULE_STD=ON
anarthal Mar 6, 2026
e3ca135
Move CMAKE_CXX_MODULE_STD
anarthal Mar 7, 2026
5244210
inlines
anarthal Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
354 changes: 354 additions & 0 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 3.5...3.20)
cmake_minimum_required(VERSION 3.5...3.31)

project(boost_core VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)

add_library(boost_core INTERFACE)
add_library(Boost::core ALIAS boost_core)
if (BOOST_USE_MODULES)
add_library(boost_core STATIC)
target_sources(boost_core PUBLIC FILE_SET CXX_MODULES BASE_DIRS modules FILES modules/boost_core.cppm)
set(__scope PUBLIC)

# Enable and propagate C++23, import std, and the modules macro
target_compile_features(boost_core PUBLIC cxx_std_23)
set_target_properties(boost_core PROPERTIES CXX_MODULE_STD 1)
target_compile_definitions(boost_core PUBLIC BOOST_USE_MODULES)

target_include_directories(boost_core INTERFACE include)
else()
add_library(boost_core INTERFACE)
set(__scope INTERFACE)
endif()

add_library(Boost::core ALIAS boost_core)
target_include_directories(boost_core ${__scope} include)
target_link_libraries(boost_core
INTERFACE
${__scope}
Boost::assert
Boost::config
Boost::throw_exception
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ install:
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\core\
- python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" core
- python libs/core/tools/setup_boost_with_modules.py # Temporary
- cmd /c bootstrap
- b2 -d0 headers

Expand Down
27 changes: 20 additions & 7 deletions include/boost/core/addressof.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_CORE_ADDRESSOF_HPP
#define BOOST_CORE_ADDRESSOF_HPP

#if defined(BOOST_USE_MODULES) && !defined(BOOST_CORE_INTERFACE_UNIT)

#ifndef BOOST_IN_MODULE_PURVIEW
import boost.core;
#endif

#else

// RP TODO: BOOST_CORE_HAS_BUILTIN_ADDRESSOF

#include <boost/core/detail/modules.hpp>
#include <boost/config.hpp>

#if defined(BOOST_MSVC_FULL_VER) && BOOST_MSVC_FULL_VER >= 190024215
Expand All @@ -33,7 +44,7 @@ Distributed under the Boost Software License, Version 1.0.

namespace boost {

template<class T>
BOOST_CORE_MODULE_EXPORT template<class T>
BOOST_CONSTEXPR inline T*
addressof(T& o) BOOST_NOEXCEPT
{
Expand All @@ -43,7 +54,7 @@ addressof(T& o) BOOST_NOEXCEPT
} /* boost */
#else
#include <boost/config/workaround.hpp>
#include <cstddef>
#include <boost/config/std/cstddef.hpp>

namespace boost {
namespace detail {
Expand Down Expand Up @@ -143,7 +154,7 @@ struct addrof_result {

} /* detail */

template<class T, std::size_t N>
BOOST_CORE_MODULE_EXPORT template<class T, std::size_t N>
BOOST_FORCEINLINE typename boost::detail::addrof_result<T[N]>::type
addressof(T (&o)[N]) BOOST_NOEXCEPT
{
Expand All @@ -152,14 +163,14 @@ addressof(T (&o)[N]) BOOST_NOEXCEPT
#endif

#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
template<class T, std::size_t N>
BOOST_CORE_MODULE_EXPORT template<class T, std::size_t N>
BOOST_FORCEINLINE
T (*addressof(T (&o)[N]) BOOST_NOEXCEPT)[N]
{
return reinterpret_cast<T(*)[N]>(&o);
}

template<class T, std::size_t N>
BOOST_CORE_MODULE_EXPORT template<class T, std::size_t N>
BOOST_FORCEINLINE
const T (*addressof(const T (&o)[N]) BOOST_NOEXCEPT)[N]
{
Expand Down Expand Up @@ -250,7 +261,7 @@ addressof(T& o) BOOST_NOEXCEPT

} /* detail */

template<class T>
BOOST_CORE_MODULE_EXPORT template<class T>
constexpr BOOST_FORCEINLINE T*
addressof(T& o) BOOST_NOEXCEPT
{
Expand All @@ -265,10 +276,12 @@ addressof(T& o) BOOST_NOEXCEPT
!defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
namespace boost {

template<class T>
BOOST_CORE_MODULE_EXPORT template<class T>
const T* addressof(const T&&) = delete;

} /* boost */
#endif

#endif

#endif
7 changes: 6 additions & 1 deletion include/boost/core/alignof.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Make the header safe to include from libraries supporting modules
#if defined(BOOST_IN_MODULE_PURVIEW) && !defined(BOOST_CORE_ALIGNOF_HPP_INCLUDED)
# error "Please #include <boost/core/alignof.hpp> in your module global fragment"
#endif

#ifndef BOOST_CORE_ALIGNOF_HPP_INCLUDED
#define BOOST_CORE_ALIGNOF_HPP_INCLUDED

Expand All @@ -12,7 +17,7 @@
// https://www.boost.org/LICENSE_1_0.txt

#include <boost/config.hpp>
#include <cstddef>
#include <boost/config/std/cstddef.hpp>

#if !defined(BOOST_NO_CXX11_ALIGNOF)

Expand Down
29 changes: 19 additions & 10 deletions include/boost/core/alloc_construct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,35 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_CORE_ALLOC_CONSTRUCT_HPP
#define BOOST_CORE_ALLOC_CONSTRUCT_HPP

#if defined(BOOST_USE_MODULES) && !defined(BOOST_CORE_INTERFACE_UNIT)
#ifndef BOOST_IN_MODULE_PURVIEW
import boost.core;
#endif
#else

/*
This functionality is now in <boost/core/allocator_access.hpp>.
*/
#include <boost/core/noinit_adaptor.hpp>
#include <boost/core/detail/modules.hpp>

namespace boost {

template<class A, class T>
BOOST_CORE_MODULE_EXPORT template<class A, class T>
inline void
alloc_destroy(A& a, T* p)
{
boost::allocator_destroy(a, p);
}

template<class A, class T>
BOOST_CORE_MODULE_EXPORT template<class A, class T>
inline void
alloc_destroy_n(A& a, T* p, std::size_t n)
{
boost::allocator_destroy_n(a, p, n);
}

template<class A, class T>
BOOST_CORE_MODULE_EXPORT template<class A, class T>
inline void
alloc_construct(A& a, T* p)
{
Expand All @@ -38,52 +45,52 @@ alloc_construct(A& a, T* p)

#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class A, class T, class U, class... V>
BOOST_CORE_MODULE_EXPORT template<class A, class T, class U, class... V>
inline void
alloc_construct(A& a, T* p, U&& u, V&&... v)
{
boost::allocator_construct(a, p, std::forward<U>(u),
std::forward<V>(v)...);
}
#else
template<class A, class T, class U>
BOOST_CORE_MODULE_EXPORT template<class A, class T, class U>
inline void
alloc_construct(A& a, T* p, U&& u)
{
boost::allocator_construct(a, p, std::forward<U>(u));
}
#endif
#else
template<class A, class T, class U>
BOOST_CORE_MODULE_EXPORT template<class A, class T, class U>
inline void
alloc_construct(A& a, T* p, const U& u)
{
boost::allocator_construct(a, p, u);
}

template<class A, class T, class U>
BOOST_CORE_MODULE_EXPORT template<class A, class T, class U>
inline void
alloc_construct(A& a, T* p, U& u)
{
boost::allocator_construct(a, p, u);
}
#endif

template<class A, class T>
BOOST_CORE_MODULE_EXPORT template<class A, class T>
inline void
alloc_construct_n(A& a, T* p, std::size_t n)
{
boost::allocator_construct_n(a, p, n);
}

template<class A, class T>
BOOST_CORE_MODULE_EXPORT template<class A, class T>
inline void
alloc_construct_n(A& a, T* p, std::size_t n, const T* l, std::size_t m)
{
boost::allocator_construct_n(a, p, n, l, m);
}

template<class A, class T, class I>
BOOST_CORE_MODULE_EXPORT template<class A, class T, class I>
inline void
alloc_construct_n(A& a, T* p, std::size_t n, I b)
{
Expand All @@ -93,3 +100,5 @@ alloc_construct_n(A& a, T* p, std::size_t n, I b)
} /* boost */

#endif

#endif
Loading
Loading