diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91ea3c8b..f814685a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,6 +248,7 @@ jobs: cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep python3 tools/boostdep/depinst/depinst.py $LIBRARY + python3 libs/mp11/tools/setup_boost_with_modules.py # Temporary ./bootstrap.sh ./b2 -d0 headers @@ -303,6 +304,7 @@ jobs: xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary cmd /c bootstrap b2 -d0 headers @@ -351,6 +353,7 @@ jobs: cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + python libs/mp11/tools/setup_boost_with_modules.py # Temporary - name: Use library with add_subdirectory run: | @@ -399,6 +402,7 @@ jobs: cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + python libs/mp11/tools/setup_boost_with_modules.py # Temporary - name: Configure run: | @@ -457,6 +461,7 @@ jobs: cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + python libs/mp11/tools/setup_boost_with_modules.py # Temporary - name: Configure run: | @@ -587,9 +592,9 @@ jobs: - name: Setup Boost run: | cd .. - git clone --depth 1 https://github.com/boostorg/assert + git clone --depth 1 https://github.com/anarthal/assert -b feature/cxx20-modules git clone --depth 1 https://github.com/boostorg/config - git clone --depth 1 https://github.com/boostorg/core + git clone --depth 1 https://github.com/anarthal/core -b feature/cxx20-modules - name: Run Tests run: | @@ -620,9 +625,9 @@ jobs: - name: Setup Boost run: | cd .. - git clone --depth 1 https://github.com/boostorg/assert + git clone --depth 1 https://github.com/anarthal/assert -b feature/cxx20-modules git clone --depth 1 https://github.com/boostorg/config - git clone --depth 1 https://github.com/boostorg/core + git clone --depth 1 https://github.com/anarthal/core -b feature/cxx20-modules - name: Run Tests shell: cmd @@ -664,6 +669,7 @@ jobs: xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary - name: Use library with add_subdirectory (Debug) shell: cmd @@ -712,6 +718,7 @@ jobs: xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary - name: Configure shell: cmd @@ -778,6 +785,7 @@ jobs: xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ git submodule update --init tools/boostdep python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary - name: Configure shell: cmd @@ -809,3 +817,313 @@ jobs: run: | cd ../boost-root/__build__ ctest --output-on-failure --no-tests=error -C Release + + posix-cmake-subdir-modules: + runs-on: ubuntu-latest + container: ubuntu:24.10 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends ninja-build cmake git ca-certificates python3 python-is-python3 \ + clang-19 llvm-19 libclang-rt-19-dev libc++-19-dev libc++abi-19-dev clang-tools-19 + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py $LIBRARY + python libs/mp11/tools/setup_boost_with_modules.py # Temporary + + - name: Use library with add_subdirectory + run: | + cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test + mkdir __build__ && cd __build__ + cmake -DBOOST_USE_MODULES=1 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-install-modules: + env: + CMAKE_ARGS: -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja + + runs-on: ubuntu-latest + container: ubuntu:24.10 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends ninja-build cmake git ca-certificates python3 python-is-python3 \ + clang-19 llvm-19 libclang-rt-19-dev libc++-19-dev libc++abi-19-dev clang-tools-19 + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py $LIBRARY + python libs/mp11/tools/setup_boost_with_modules.py # Temporary + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local -DBOOST_USE_MODULES=1 $CMAKE_ARGS .. + + - name: Install + run: | + cd ../boost-root/__build__ + cmake --build . --target install + + - name: Use the installed library + run: | + cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=~/.local $CMAKE_ARGS .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-test-modules: + strategy: + fail-fast: false + matrix: + include: + - cmake-build-type: Debug + - cmake-build-type: Release + + runs-on: ubuntu-latest + container: ubuntu:24.10 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends ninja-build cmake git ca-certificates python3 python-is-python3 \ + clang-19 llvm-19 libclang-rt-19-dev libc++-19-dev libc++abi-19-dev clang-tools-19 + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python3 tools/boostdep/depinst/depinst.py $LIBRARY + python3 libs/mp11/tools/setup_boost_with_modules.py # Temporary + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${{matrix.cmake-build-type}} -DBOOST_USE_MODULES=1 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja .. + + - name: Build tests + run: | + cd ../boost-root/__build__ + cmake --build . --target tests + + - name: Run tests + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error + + windows-cmake-subdir-modules: + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: choco install --no-progress ninja + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary + + - name: Use library with add_subdirectory + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test + mkdir __build__ && cd __build__ + cmake -DBOOST_USE_MODULES=1 -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja .. + cmake --build . + ctest --output-on-failure --no-tests=error + + windows-cmake-install-modules: + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: choco install --no-progress ninja + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary + + - name: Configure + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix -DBOOST_USE_MODULES=1 -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja .. + + - name: Install + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root/__build__ + cmake --build . --target install + + - name: Use the installed library + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja .. + cmake --build . + ctest --output-on-failure --no-tests=error + + windows-cmake-test-modules: + strategy: + fail-fast: false + matrix: + include: + - cmake-build-type: Debug + - cmake-build-type: Release + + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: choco install --no-progress ninja + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + python libs/mp11/tools/setup_boost_with_modules.py # Temporary + + - name: Configure + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON -DBOOST_USE_MODULES=1 -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -DCMAKE_BUILD_TYPE=${{matrix.cmake-build-type}} -G Ninja .. + + - name: Build tests + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root/__build__ + cmake --build . --target tests + + - name: Run tests + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64 + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error diff --git a/CMakeLists.txt b/CMakeLists.txt index a76ecc5e..6ad4803c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,18 +2,37 @@ # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required(VERSION 3.5...3.16) +cmake_minimum_required(VERSION 3.5...3.31) project(boost_mp11 VERSION 1.89.0 LANGUAGES CXX) -add_library(boost_mp11 INTERFACE) +if (BOOST_USE_MODULES) + add_library(boost_mp11 STATIC) + target_sources(boost_mp11 PUBLIC FILE_SET CXX_MODULES BASE_DIRS modules FILES modules/boost_mp11.cppm) + set(__scope PUBLIC) + + # Enable and propagate C++23, import std, and the modules macro + target_compile_features(boost_mp11 PUBLIC cxx_std_23) + set_target_properties(boost_mp11 PROPERTIES CXX_MODULE_STD 1) + target_compile_definitions(boost_mp11 PUBLIC BOOST_USE_MODULES) + +else() + add_library(boost_mp11 INTERFACE) + target_compile_features(boost_mp11 INTERFACE cxx_alias_templates cxx_variadic_templates cxx_decltype) + set(__scope INTERFACE) +endif() + add_library(Boost::mp11 ALIAS boost_mp11) +target_include_directories(boost_mp11 ${__scope} include) -target_include_directories(boost_mp11 INTERFACE include) -target_compile_features(boost_mp11 INTERFACE cxx_alias_templates cxx_variadic_templates cxx_decltype) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # Required to call deprecated FetchContent_Populate + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0") + cmake_policy(SET CMP0169 OLD) + endif() + # Fetch support files message(STATUS "Fetching BoostFetch.cmake") diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index dd39fbaa..b38ffa1e 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -8,6 +8,13 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt +#if defined(BOOST_USE_MODULES) && !defined(BOOST_MP11_INTERFACE_UNIT) + +#include +import boost.mp11; + +#else + #include #include #include @@ -23,8 +30,8 @@ #include #include #include -#include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -1350,4 +1357,6 @@ template using mp_join = mp_apply +import boost.mp11; + +#else + #include #include -#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -117,4 +124,6 @@ template using mp_bind_q = mp_bind; # pragma pop_macro( "I" ) #endif +#endif + #endif // #ifndef BOOST_MP11_BIND_HPP_INCLUDED diff --git a/include/boost/mp11/detail/mp_plus.hpp b/include/boost/mp11/detail/mp_plus.hpp index 5c9417cd..2c6342ed 100644 --- a/include/boost/mp11/detail/mp_plus.hpp +++ b/include/boost/mp11/detail/mp_plus.hpp @@ -9,7 +9,7 @@ // http://www.boost.org/LICENSE_1_0.txt #include -#include +#include namespace boost { diff --git a/include/boost/mp11/detail/mp_value.hpp b/include/boost/mp11/detail/mp_value.hpp index d0e59825..5c53b40c 100644 --- a/include/boost/mp11/detail/mp_value.hpp +++ b/include/boost/mp11/detail/mp_value.hpp @@ -6,7 +6,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include -#include +#include #if defined(BOOST_MP11_HAS_TEMPLATE_AUTO) diff --git a/include/boost/mp11/detail/mp_with_index.hpp b/include/boost/mp11/detail/mp_with_index.hpp index b6932f2d..b23d4654 100644 --- a/include/boost/mp11/detail/mp_with_index.hpp +++ b/include/boost/mp11/detail/mp_with_index.hpp @@ -10,9 +10,9 @@ #include #include -#include -#include -#include +#include +#include +#include #if defined( BOOST_MP11_HAS_CXX14_CONSTEXPR ) # define BOOST_MP11_CONSTEXPR14 constexpr diff --git a/include/boost/mp11/detail/std/cassert.hpp b/include/boost/mp11/detail/std/cassert.hpp new file mode 100644 index 00000000..7ff79890 --- /dev/null +++ b/include/boost/mp11/detail/std/cassert.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_COMPATIBILITY_HEADERS_SKIP_IMPORT +import std; +#endif +#else +#include +#endif diff --git a/include/boost/mp11/detail/std/cstddef.hpp b/include/boost/mp11/detail/std/cstddef.hpp new file mode 100644 index 00000000..680f6eb4 --- /dev/null +++ b/include/boost/mp11/detail/std/cstddef.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_COMPATIBILITY_HEADERS_SKIP_IMPORT +import std; +#endif +#else +#include +#endif diff --git a/include/boost/mp11/detail/std/tuple.hpp b/include/boost/mp11/detail/std/tuple.hpp new file mode 100644 index 00000000..f701c057 --- /dev/null +++ b/include/boost/mp11/detail/std/tuple.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_COMPATIBILITY_HEADERS_SKIP_IMPORT +import std; +#endif +#else +#include +#endif diff --git a/include/boost/mp11/detail/std/type_traits.hpp b/include/boost/mp11/detail/std/type_traits.hpp new file mode 100644 index 00000000..992892e1 --- /dev/null +++ b/include/boost/mp11/detail/std/type_traits.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_COMPATIBILITY_HEADERS_SKIP_IMPORT +import std; +#endif +#else +#include +#endif diff --git a/include/boost/mp11/detail/std/utility.hpp b/include/boost/mp11/detail/std/utility.hpp new file mode 100644 index 00000000..0bb26c69 --- /dev/null +++ b/include/boost/mp11/detail/std/utility.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_COMPATIBILITY_HEADERS_SKIP_IMPORT +import std; +#endif +#else +#include +#endif diff --git a/include/boost/mp11/function.hpp b/include/boost/mp11/function.hpp index e20b4520..90f2dc00 100644 --- a/include/boost/mp11/function.hpp +++ b/include/boost/mp11/function.hpp @@ -8,6 +8,13 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt +#if defined(BOOST_USE_MODULES) && !defined(BOOST_MP11_INTERFACE_UNIT) + +#include +import boost.mp11; + +#else + #include #include #include @@ -16,7 +23,7 @@ #include #include #include -#include +#include namespace boost { @@ -219,4 +226,6 @@ template using mp_max = mp_max_element, } // namespace mp11 } // namespace boost +#endif + #endif // #ifndef BOOST_MP11_FUNCTION_HPP_INCLUDED diff --git a/include/boost/mp11/integer_sequence.hpp b/include/boost/mp11/integer_sequence.hpp index 013991fa..6dbf1478 100644 --- a/include/boost/mp11/integer_sequence.hpp +++ b/include/boost/mp11/integer_sequence.hpp @@ -8,8 +8,15 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt +#if defined(BOOST_USE_MODULES) && !defined(BOOST_MP11_INTERFACE_UNIT) + #include -#include +import boost.mp11; + +#else + +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -118,4 +125,6 @@ template using index_sequence_for = make_integer_sequence +import boost.mp11; + +#else + #include #include -#include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -48,4 +55,6 @@ template using mp_size_t = std::integral_constant # pragma pop_macro( "I" ) #endif +#endif + #endif // #ifndef BOOST_MP11_INTEGRAL_HPP_INCLUDED diff --git a/include/boost/mp11/lambda.hpp b/include/boost/mp11/lambda.hpp index 3d027c2a..e14cc44b 100644 --- a/include/boost/mp11/lambda.hpp +++ b/include/boost/mp11/lambda.hpp @@ -8,6 +8,13 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt +#if defined(BOOST_USE_MODULES) && !defined(BOOST_MP11_INTERFACE_UNIT) + +#include +import boost.mp11; + +#else + #include #if BOOST_MP11_WORKAROUND(BOOST_MP11_MSVC, <= 1800) @@ -17,8 +24,8 @@ #else #include -#include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -196,4 +203,6 @@ template