diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32bdc34e..790d2f46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,6 +254,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 @@ -309,6 +310,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 @@ -357,6 +359,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: | @@ -405,6 +408,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: | @@ -463,6 +467,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: | @@ -597,9 +602,9 @@ jobs: - name: Setup Boost run: | cd .. - git clone --depth 1 https://github.com/boostorg/assert - 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/assert -b feature/cxx20-modules + git clone --depth 1 https://github.com/anarthal/config -b feature/cxx20-modules + git clone --depth 1 https://github.com/anarthal/core -b feature/cxx20-modules - name: Run Tests run: | @@ -634,9 +639,9 @@ jobs: - name: Setup Boost run: | cd .. - git clone --depth 1 https://github.com/boostorg/assert - 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/assert -b feature/cxx20-modules + git clone --depth 1 https://github.com/anarthal/config -b feature/cxx20-modules + git clone --depth 1 https://github.com/anarthal/core -b feature/cxx20-modules - name: Run Tests shell: cmd @@ -678,6 +683,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 @@ -726,6 +732,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 @@ -792,6 +799,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 @@ -823,3 +831,383 @@ jobs: run: | cd ../boost-root/__build__ ctest --output-on-failure --no-tests=error -C Release + + posix-cmake-subdir-modules: + strategy: + fail-fast: false + matrix: + include: + - name: "clang-21 Debug" + packages: "clang-21 libc++-21-dev" + cmake-args: "-DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STDLIB_MODULES_JSON=/usr/lib/llvm-21/lib/libc++.modules.json -DCMAKE_BUILD_TYPE=Debug" + - name: "clang-21 Release" + packages: "clang-21 libc++-21-dev" + cmake-args: "-DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STDLIB_MODULES_JSON=/usr/lib/llvm-21/lib/libc++.modules.json -DCMAKE_BUILD_TYPE=Release" + - name: "gcc-15 Debug" + packages: "g++-15" + cmake-args: "-DCMAKE_CXX_COMPILER=g++-15 -DCMAKE_BUILD_TYPE=Debug" + + name: CMake subdir modules ${{ matrix.name }} + + + runs-on: ubuntu-latest + container: ubuntu:26.04 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends wget ninja-build git ca-certificates python3 python-is-python3 ${{ matrix.packages }} + ./tools/install-cmake.sh + + - 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 \ + -G Ninja \ + -DCMAKE_CXX_STANDARD=23 \ + -DBUILD_TESTING=ON \ + -DBOOST_INCLUDE_LIBRARIES=$LIBRARY \ + -DBOOST_USE_MODULES=ON \ + -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=d0edc3af-4c50-42ea-a356-e2862fe7a444 \ + ${{ matrix.cmake-args }} \ + .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-install-modules: + strategy: + fail-fast: false + matrix: + include: + - name: "clang-21 Debug" + packages: "clang-21 libc++-21-dev" + cmake-args: "-DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STDLIB_MODULES_JSON=/usr/lib/llvm-21/lib/libc++.modules.json -DCMAKE_BUILD_TYPE=Debug" + - name: "clang-21 Release" + packages: "clang-21 libc++-21-dev" + cmake-args: "-DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STDLIB_MODULES_JSON=/usr/lib/llvm-21/lib/libc++.modules.json -DCMAKE_BUILD_TYPE=Release" + - name: "gcc-15 Debug" + packages: "g++-15" + cmake-args: "-DCMAKE_CXX_COMPILER=g++-15 -DCMAKE_BUILD_TYPE=Debug" + + name: CMake install modules ${{ matrix.name }} + + runs-on: ubuntu-latest + container: ubuntu:26.04 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends wget ninja-build git ca-certificates python3 python-is-python3 ${{ matrix.packages }} + ./tools/install-cmake.sh + + - 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 \ + -G Ninja \ + -DCMAKE_CXX_STANDARD=23 \ + -DBOOST_INCLUDE_LIBRARIES=$LIBRARY \ + -DCMAKE_INSTALL_PREFIX=~/.local \ + -DBOOST_USE_MODULES=ON \ + -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=d0edc3af-4c50-42ea-a356-e2862fe7a444 \ + ${{ matrix.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 \ + -G Ninja \ + -DCMAKE_CXX_STANDARD=23 \ + -DCMAKE_INSTALL_PREFIX=~/.local \ + -DBOOST_USE_MODULES=ON \ + -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=d0edc3af-4c50-42ea-a356-e2862fe7a444 \ + ${{ matrix.cmake-args }} \ + .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-test-modules: + strategy: + fail-fast: false + matrix: + include: + - name: "clang-21 Debug" + packages: "clang-21 libc++-21-dev" + cmake-args: "-DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STDLIB_MODULES_JSON=/usr/lib/llvm-21/lib/libc++.modules.json -DCMAKE_BUILD_TYPE=Debug" + - name: "clang-21 Release" + packages: "clang-21 libc++-21-dev" + cmake-args: "-DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STDLIB_MODULES_JSON=/usr/lib/llvm-21/lib/libc++.modules.json -DCMAKE_BUILD_TYPE=Release" + - name: "gcc-15 Debug" + packages: "g++-15" + cmake-args: "-DCMAKE_CXX_COMPILER=g++-15 -DCMAKE_BUILD_TYPE=Debug" + + name: CMake test modules ${{ matrix.name }} + + runs-on: ubuntu-latest + container: ubuntu:26.04 + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y --no-install-recommends wget ninja-build git ca-certificates python3 python-is-python3 ${{ matrix.packages }} + ./tools/install-cmake.sh + + - 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 \ + -G Ninja \ + -DCMAKE_CXX_STANDARD=23 \ + -DBOOST_INCLUDE_LIBRARIES=$LIBRARY \ + -DBUILD_TESTING=ON \ + -DBOOST_USE_MODULES=ON \ + -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=d0edc3af-4c50-42ea-a356-e2862fe7a444 \ + ${{ matrix.cmake-args }} \ + .. + + - 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 17a04cf5..f55e8bdd 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.91.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") @@ -40,10 +59,11 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(BUILD_TESTING OFF) # hide cache variable - boost_fetch(boostorg/assert TAG develop EXCLUDE_FROM_ALL) - boost_fetch(boostorg/config TAG develop EXCLUDE_FROM_ALL) - boost_fetch(boostorg/core TAG develop EXCLUDE_FROM_ALL) - boost_fetch(boostorg/throw_exception TAG develop EXCLUDE_FROM_ALL) + # TODO: restore these tags once we start merging PRs + boost_fetch(anarthal/assert TAG feature/cxx20-modules EXCLUDE_FROM_ALL) + boost_fetch(anarthal/config TAG feature/cxx20-modules EXCLUDE_FROM_ALL) + boost_fetch(anarthal/core TAG feature/cxx20-modules EXCLUDE_FROM_ALL) + boost_fetch(anarthal/throw_exception TAG feature/cxx20-modules EXCLUDE_FROM_ALL) unset(BUILD_TESTING) diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 07a8ffd8..55784c73 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -8,6 +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 +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.mp11; +#endif + +#else + #include #include #include @@ -23,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -132,23 +141,23 @@ template class F, class... L> struct mp_transform_cuda_workar #if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, == 1900 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40800 ) -template class F, class... L> using mp_transform = typename mp_if::type, detail::mp_transform_impl, detail::list_size_mismatch>::type; +BOOST_MP11_EXPORT template class F, class... L> using mp_transform = typename mp_if::type, detail::mp_transform_impl, detail::list_size_mismatch>::type; #else #if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 ) -template class F, class... L> using mp_transform = typename detail::mp_transform_cuda_workaround< F, L...>::type::type; +BOOST_MP11_EXPORT template class F, class... L> using mp_transform = typename detail::mp_transform_cuda_workaround< F, L...>::type::type; #else -template class F, class... L> using mp_transform = typename mp_if...>, detail::mp_transform_impl, detail::list_size_mismatch>::type; +BOOST_MP11_EXPORT template class F, class... L> using mp_transform = typename mp_if...>, detail::mp_transform_impl, detail::list_size_mismatch>::type; #endif #endif -template using mp_transform_q = mp_transform; +BOOST_MP11_EXPORT template using mp_transform_q = mp_transform; namespace detail { @@ -195,8 +204,8 @@ template class P, template class F, class... L> str } // namespace detail -template class P, template class F, class... L> using mp_transform_if = typename detail::mp_transform_if_impl::type; -template using mp_transform_if_q = typename detail::mp_transform_if_impl::type; +BOOST_MP11_EXPORT template class P, template class F, class... L> using mp_transform_if = typename detail::mp_transform_if_impl::type; +BOOST_MP11_EXPORT template using mp_transform_if_q = typename detail::mp_transform_if_impl::type; // mp_filter namespace detail @@ -216,8 +225,8 @@ template class P, class L1, class... L> struct mp_filter_impl } // namespace detail -template class P, class... L> using mp_filter = typename detail::mp_filter_impl::type; -template using mp_filter_q = typename detail::mp_filter_impl::type; +BOOST_MP11_EXPORT template class P, class... L> using mp_filter = typename detail::mp_filter_impl::type; +BOOST_MP11_EXPORT template using mp_filter_q = typename detail::mp_filter_impl::type; // mp_fill namespace detail @@ -254,10 +263,10 @@ template class L, auto... A, class V> struct mp_fill_impl using mp_fill = typename detail::mp_fill_impl::type; +BOOST_MP11_EXPORT template using mp_fill = typename detail::mp_fill_impl::type; // mp_contains -template using mp_contains = mp_to_bool>; +BOOST_MP11_EXPORT template using mp_contains = mp_to_bool>; // mp_repeat(_c) namespace detail @@ -283,8 +292,8 @@ template struct mp_repeat_c_impl } // namespace detail -template using mp_repeat_c = typename detail::mp_repeat_c_impl::type; -template using mp_repeat = typename detail::mp_repeat_c_impl::type; +BOOST_MP11_EXPORT template using mp_repeat_c = typename detail::mp_repeat_c_impl::type; +BOOST_MP11_EXPORT template using mp_repeat = typename detail::mp_repeat_c_impl::type; // mp_product namespace detail @@ -320,8 +329,8 @@ template class F, class L1, class... L> struct mp_product_imp } // namespace detail -template class F, class... L> using mp_product = typename detail::mp_product_impl::type; -template using mp_product_q = typename detail::mp_product_impl::type; +BOOST_MP11_EXPORT template class F, class... L> using mp_product = typename detail::mp_product_impl::type; +BOOST_MP11_EXPORT template using mp_product_q = typename detail::mp_product_impl::type; // mp_drop(_c) namespace detail @@ -340,9 +349,9 @@ template class L, class... T, template class L2, cl } // namespace detail -template using mp_drop_c = mp_assign, mp_repeat_c, N>, mp_bool::value>>::type>; +BOOST_MP11_EXPORT template using mp_drop_c = mp_assign, mp_repeat_c, N>, mp_bool::value>>::type>; -template using mp_drop = mp_drop_c; +BOOST_MP11_EXPORT template using mp_drop = mp_drop_c; // mp_from_sequence namespace detail @@ -362,11 +371,11 @@ template class S, class U, U... J, class F> struct mp_ } // namespace detail -template> using mp_from_sequence = typename detail::mp_from_sequence_impl::type; +BOOST_MP11_EXPORT template> using mp_from_sequence = typename detail::mp_from_sequence_impl::type; // mp_iota(_c) -template using mp_iota_c = mp_from_sequence, mp_size_t>; -template> using mp_iota = mp_from_sequence::type, N::value>, F>; +BOOST_MP11_EXPORT template using mp_iota_c = mp_from_sequence, mp_size_t>; +BOOST_MP11_EXPORT template> using mp_iota = mp_from_sequence::type, N::value>, F>; // mp_at(_c) namespace detail @@ -413,15 +422,15 @@ template struct mp_at_c_cuda_workaround #if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 ) -template using mp_at_c = typename detail::mp_at_c_cuda_workaround< L, I >::type::type; +BOOST_MP11_EXPORT template using mp_at_c = typename detail::mp_at_c_cuda_workaround< L, I >::type::type; #else -template using mp_at_c = typename mp_if_c<(I < mp_size::value), detail::mp_at_c_impl, void>::type; +BOOST_MP11_EXPORT template using mp_at_c = typename mp_if_c<(I < mp_size::value), detail::mp_at_c_impl, void>::type; #endif -template using mp_at = mp_at_c; +BOOST_MP11_EXPORT template using mp_at = mp_at_c; // mp_take(_c) namespace detail @@ -499,18 +508,18 @@ struct mp_take_c_impl, typen } // namespace detail -template using mp_take_c = mp_assign>::type>; -template using mp_take = mp_take_c; +BOOST_MP11_EXPORT template using mp_take_c = mp_assign>::type>; +BOOST_MP11_EXPORT template using mp_take = mp_take_c; // mp_slice(_c) -template using mp_slice_c = mp_drop_c< mp_take_c, I >; -template using mp_slice = mp_drop< mp_take, I >; +BOOST_MP11_EXPORT template using mp_slice_c = mp_drop_c< mp_take_c, I >; +BOOST_MP11_EXPORT template using mp_slice = mp_drop< mp_take, I >; // mp_back -template using mp_back = mp_at_c::value - 1>; +BOOST_MP11_EXPORT template using mp_back = mp_at_c::value - 1>; // mp_pop_back -template using mp_pop_back = mp_take_c::value - 1>; +BOOST_MP11_EXPORT template using mp_pop_back = mp_take_c::value - 1>; // mp_replace namespace detail @@ -531,7 +540,7 @@ template class L, class... T, class V, class W> struct mp_rep } // namespace detail -template using mp_replace = typename detail::mp_replace_impl::type; +BOOST_MP11_EXPORT template using mp_replace = typename detail::mp_replace_impl::type; // mp_replace_if namespace detail @@ -552,8 +561,8 @@ template class L, class... T, template class P, cla } // namespace detail -template class P, class W> using mp_replace_if = typename detail::mp_replace_if_impl::type; -template using mp_replace_if_q = mp_replace_if; +BOOST_MP11_EXPORT template class P, class W> using mp_replace_if = typename detail::mp_replace_if_impl::type; +BOOST_MP11_EXPORT template using mp_replace_if_q = mp_replace_if; // mp_copy_if // in detail/mp_copy_if.hpp @@ -577,7 +586,7 @@ template class L, class... T, class V> struct mp_remove_impl< } // namespace detail -template using mp_remove = typename detail::mp_remove_impl::type; +BOOST_MP11_EXPORT template using mp_remove = typename detail::mp_remove_impl::type; // mp_remove_if // in detail/mp_remove_if.hpp @@ -593,7 +602,7 @@ template struct mp_flatten_impl } // namespace detail -template> using mp_flatten = mp_apply, L>, mp_clear>>; +BOOST_MP11_EXPORT template> using mp_flatten = mp_apply, L>, mp_clear>>; // mp_partition namespace detail @@ -608,8 +617,8 @@ template class L, class... T, template class P> str } // namespace detail -template class P> using mp_partition = typename detail::mp_partition_impl::type; -template using mp_partition_q = mp_partition; +BOOST_MP11_EXPORT template class P> using mp_partition = typename detail::mp_partition_impl::type; +BOOST_MP11_EXPORT template using mp_partition_q = mp_partition; // mp_sort namespace detail @@ -653,8 +662,8 @@ template class L, class T1, class... T, template cl } // namespace detail -template class P> using mp_sort = typename detail::mp_sort_impl::type; -template using mp_sort_q = mp_sort; +BOOST_MP11_EXPORT template class P> using mp_sort = typename detail::mp_sort_impl::type; +BOOST_MP11_EXPORT template using mp_sort_q = mp_sort; // mp_nth_element(_c) namespace detail @@ -714,9 +723,9 @@ template class L, class T1, class... T, std::size_t I, templa } // namespace detail -template class P> using mp_nth_element_c = typename detail::mp_nth_element_impl::type; -template class P> using mp_nth_element = typename detail::mp_nth_element_impl::type; -template using mp_nth_element_q = mp_nth_element; +BOOST_MP11_EXPORT template class P> using mp_nth_element_c = typename detail::mp_nth_element_impl::type; +BOOST_MP11_EXPORT template class P> using mp_nth_element = typename detail::mp_nth_element_impl::type; +BOOST_MP11_EXPORT template using mp_nth_element_q = mp_nth_element; // mp_find namespace detail @@ -795,7 +804,7 @@ template class L, class T1, class... T, class V> struct mp_fi } // namespace detail -template using mp_find = typename detail::mp_find_impl::type; +BOOST_MP11_EXPORT template using mp_find = typename detail::mp_find_impl::type; // mp_find_if namespace detail @@ -850,8 +859,8 @@ template class L, class T1, class... T, template cl } // namespace detail -template class P> using mp_find_if = typename detail::mp_find_if_impl::type; -template using mp_find_if_q = mp_find_if; +BOOST_MP11_EXPORT template class P> using mp_find_if = typename detail::mp_find_if_impl::type; +BOOST_MP11_EXPORT template using mp_find_if_q = mp_find_if; // mp_reverse namespace detail @@ -928,7 +937,7 @@ template class L, class T1, class T2, class T3, class T4, cla } // namespace detail -template using mp_reverse = typename detail::mp_reverse_impl::type; +BOOST_MP11_EXPORT template using mp_reverse = typename detail::mp_reverse_impl::type; // mp_fold // in detail/mp_fold.hpp @@ -970,8 +979,8 @@ template class L, class T1, class T2, class T3, class T4, cla } // namespace detail -template class F> using mp_reverse_fold = typename detail::mp_reverse_fold_impl, V, F>::type; -template using mp_reverse_fold_q = mp_reverse_fold; +BOOST_MP11_EXPORT template class F> using mp_reverse_fold = typename detail::mp_reverse_fold_impl, V, F>::type; +BOOST_MP11_EXPORT template using mp_reverse_fold_q = mp_reverse_fold; // mp_unique namespace detail @@ -986,7 +995,7 @@ template class L, class... T> struct mp_unique_impl> } // namespace detail -template using mp_unique = typename detail::mp_unique_impl::type; +BOOST_MP11_EXPORT template using mp_unique = typename detail::mp_unique_impl::type; // mp_unique_if namespace detail @@ -1009,22 +1018,22 @@ template class P> struct mp_unique_if_push_back } // namespace detail -template class P> +BOOST_MP11_EXPORT template class P> using mp_unique_if = mp_fold_q, detail::mp_unique_if_push_back

>; -template using mp_unique_if_q = mp_unique_if; +BOOST_MP11_EXPORT template using mp_unique_if_q = mp_unique_if; // mp_all_of -template class P> using mp_all_of = mp_bool< mp_count_if::value == mp_size::value >; -template using mp_all_of_q = mp_all_of; +BOOST_MP11_EXPORT template class P> using mp_all_of = mp_bool< mp_count_if::value == mp_size::value >; +BOOST_MP11_EXPORT template using mp_all_of_q = mp_all_of; // mp_none_of -template class P> using mp_none_of = mp_bool< mp_count_if::value == 0 >; -template using mp_none_of_q = mp_none_of; +BOOST_MP11_EXPORT template class P> using mp_none_of = mp_bool< mp_count_if::value == 0 >; +BOOST_MP11_EXPORT template using mp_none_of_q = mp_none_of; // mp_any_of -template class P> using mp_any_of = mp_bool< mp_count_if::value != 0 >; -template using mp_any_of_q = mp_any_of; +BOOST_MP11_EXPORT template class P> using mp_any_of = mp_bool< mp_count_if::value != 0 >; +BOOST_MP11_EXPORT template using mp_any_of_q = mp_any_of; // mp_replace_at_c namespace detail @@ -1042,8 +1051,8 @@ template struct mp_replace_at_impl } // namespace detail -template using mp_replace_at = typename detail::mp_replace_at_impl::type; -template using mp_replace_at_c = typename detail::mp_replace_at_impl, W>::type; +BOOST_MP11_EXPORT template using mp_replace_at = typename detail::mp_replace_at_impl::type; +BOOST_MP11_EXPORT template using mp_replace_at_c = typename detail::mp_replace_at_impl, W>::type; //mp_for_each(f) namespace detail @@ -1066,12 +1075,12 @@ template BOOST_MP11_CONSTEXPR F mp_for_each_impl( mp_list<>, F && f ) // msvc has a limit of 1024 -template BOOST_MP11_CONSTEXPR mp_if_c::value <= 1024, F> mp_for_each( F && f ) +BOOST_MP11_EXPORT template BOOST_MP11_CONSTEXPR mp_if_c::value <= 1024, F> mp_for_each( F && f ) { return detail::mp_for_each_impl( mp_rename(), std::forward(f) ); } -template BOOST_MP11_CONSTEXPR mp_if_c::value >= 1025, F> mp_for_each( F && f ) +BOOST_MP11_EXPORT template BOOST_MP11_CONSTEXPR mp_if_c::value >= 1025, F> mp_for_each( F && f ) { using L2 = mp_rename; @@ -1083,7 +1092,7 @@ template BOOST_MP11_CONSTEXPR mp_if_c::value >= 102 #else -template BOOST_MP11_CONSTEXPR F mp_for_each( F && f ) +BOOST_MP11_EXPORT template BOOST_MP11_CONSTEXPR F mp_for_each( F && f ) { return detail::mp_for_each_impl( mp_rename(), std::forward(f) ); } @@ -1091,16 +1100,16 @@ template BOOST_MP11_CONSTEXPR F mp_for_each( F && f ) #endif // mp_insert -template using mp_insert = mp_append, mp_push_front, T...>>; +BOOST_MP11_EXPORT template using mp_insert = mp_append, mp_push_front, T...>>; // mp_insert_c -template using mp_insert_c = mp_append, mp_push_front, T...>>; +BOOST_MP11_EXPORT template using mp_insert_c = mp_append, mp_push_front, T...>>; // mp_erase -template using mp_erase = mp_append, mp_drop>; +BOOST_MP11_EXPORT template using mp_erase = mp_append, mp_drop>; // mp_erase_c -template using mp_erase_c = mp_append, mp_drop_c>; +BOOST_MP11_EXPORT template using mp_erase_c = mp_append, mp_drop_c>; // mp_starts_with // contributed by Glen Joseph Fernandes (glenjofe@gmail.com) @@ -1123,7 +1132,7 @@ struct mp_starts_with_impl, L2 > { } // namespace detail -template +BOOST_MP11_EXPORT template using mp_starts_with = typename detail::mp_starts_with_impl::type; // mp_rotate_left(_c) @@ -1141,12 +1150,12 @@ template> using mp_rotate_imp } // namespace detail -template using mp_rotate_left_c = detail::mp_rotate_impl::value, N>>; -template using mp_rotate_left = mp_rotate_left_c; +BOOST_MP11_EXPORT template using mp_rotate_left_c = detail::mp_rotate_impl::value, N>>; +BOOST_MP11_EXPORT template using mp_rotate_left = mp_rotate_left_c; // mp_rotate_right(_c) -template using mp_rotate_right_c = mp_rotate_left::value, N>>; -template using mp_rotate_right = mp_rotate_right_c; +BOOST_MP11_EXPORT template using mp_rotate_right_c = mp_rotate_left::value, N>>; +BOOST_MP11_EXPORT template using mp_rotate_right = mp_rotate_right_c; // mp_min_element // mp_max_element @@ -1160,7 +1169,7 @@ template struct mp_power_set_impl; } // namespace detail -template using mp_power_set = typename detail::mp_power_set_impl::type; +BOOST_MP11_EXPORT template using mp_power_set = typename detail::mp_power_set_impl::type; namespace detail { @@ -1214,8 +1223,8 @@ template class F> struct mp_partial_sum_impl_f } // namespace detail -template class F> using mp_partial_sum = mp_second>, detail::mp_partial_sum_impl_f> >; -template using mp_partial_sum_q = mp_partial_sum; +BOOST_MP11_EXPORT template class F> using mp_partial_sum = mp_second>, detail::mp_partial_sum_impl_f> >; +BOOST_MP11_EXPORT template using mp_partial_sum_q = mp_partial_sum; // mp_iterate namespace detail @@ -1225,7 +1234,7 @@ template class F, template class R, class } // namespace detail -template class F, template class R> using mp_iterate = typename detail::mp_iterate_impl>::type; +BOOST_MP11_EXPORT template class F, template class R> using mp_iterate = typename detail::mp_iterate_impl>::type; namespace detail { @@ -1243,7 +1252,7 @@ template class F, template class R> struct } // namespace detail -template using mp_iterate_q = mp_iterate; +BOOST_MP11_EXPORT template using mp_iterate_q = mp_iterate; // mp_pairwise_fold namespace detail @@ -1253,8 +1262,8 @@ template using mp_pairwise_fold_impl = mp_transform_q using mp_pairwise_fold_q = mp_eval_if, mp_clear, detail::mp_pairwise_fold_impl, L, Q>; -template class F> using mp_pairwise_fold = mp_pairwise_fold_q>; +BOOST_MP11_EXPORT template using mp_pairwise_fold_q = mp_eval_if, mp_clear, detail::mp_pairwise_fold_impl, L, Q>; +BOOST_MP11_EXPORT template class F> using mp_pairwise_fold = mp_pairwise_fold_q>; // mp_sliding_fold namespace detail @@ -1280,8 +1289,8 @@ template struct mp_sliding_fold_impl using mp_sliding_fold_q = typename detail::mp_sliding_fold_impl::value >= N::value)>, L, N, Q>::type; -template class F> using mp_sliding_fold = mp_sliding_fold_q>; +BOOST_MP11_EXPORT template using mp_sliding_fold_q = typename detail::mp_sliding_fold_impl::value >= N::value)>, L, N, Q>::type; +BOOST_MP11_EXPORT template class F> using mp_sliding_fold = mp_sliding_fold_q>; // mp_intersperse namespace detail @@ -1315,7 +1324,7 @@ template class L, class T1, class... T, class S> struct mp_in } // namespace detail -template using mp_intersperse = typename detail::mp_intersperse_impl::type; +BOOST_MP11_EXPORT template using mp_intersperse = typename detail::mp_intersperse_impl::type; // mp_split namespace detail @@ -1325,7 +1334,7 @@ template struct mp_split_impl; } // namespace detail -template using mp_split = typename detail::mp_split_impl>::type; +BOOST_MP11_EXPORT template using mp_split = typename detail::mp_split_impl>::type; namespace detail { @@ -1341,7 +1350,7 @@ template struct mp_split_impl // mp_join -template using mp_join = mp_apply>>; +BOOST_MP11_EXPORT template using mp_join = mp_apply>>; } // namespace mp11 } // namespace boost @@ -1350,4 +1359,6 @@ template using mp_join = mp_apply +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.mp11; +#endif + +#else + #include #include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -23,7 +33,7 @@ namespace mp11 { // mp_bind_front -template class F, class... T> struct mp_bind_front +BOOST_MP11_EXPORT template class F, class... T> struct mp_bind_front { // the indirection through mp_defer works around the language inability // to expand U... into a fixed parameter list of an alias template @@ -31,34 +41,34 @@ template class F, class... T> struct mp_bind_front template using fn = typename mp_defer::type; }; -template using mp_bind_front_q = mp_bind_front; +BOOST_MP11_EXPORT template using mp_bind_front_q = mp_bind_front; // mp_bind_back -template class F, class... T> struct mp_bind_back +BOOST_MP11_EXPORT template class F, class... T> struct mp_bind_back { template using fn = typename mp_defer::type; }; -template using mp_bind_back_q = mp_bind_back; +BOOST_MP11_EXPORT template using mp_bind_back_q = mp_bind_back; // mp_arg -template struct mp_arg +BOOST_MP11_EXPORT template struct mp_arg { template using fn = mp_at_c, I>; }; -using _1 = mp_arg<0>; -using _2 = mp_arg<1>; -using _3 = mp_arg<2>; -using _4 = mp_arg<3>; -using _5 = mp_arg<4>; -using _6 = mp_arg<5>; -using _7 = mp_arg<6>; -using _8 = mp_arg<7>; -using _9 = mp_arg<8>; +BOOST_MP11_EXPORT using _1 = mp_arg<0>; +BOOST_MP11_EXPORT using _2 = mp_arg<1>; +BOOST_MP11_EXPORT using _3 = mp_arg<2>; +BOOST_MP11_EXPORT using _4 = mp_arg<3>; +BOOST_MP11_EXPORT using _5 = mp_arg<4>; +BOOST_MP11_EXPORT using _6 = mp_arg<5>; +BOOST_MP11_EXPORT using _7 = mp_arg<6>; +BOOST_MP11_EXPORT using _8 = mp_arg<7>; +BOOST_MP11_EXPORT using _9 = mp_arg<8>; // mp_bind -template class F, class... T> struct mp_bind; +BOOST_MP11_EXPORT template class F, class... T> struct mp_bind; namespace detail { @@ -90,7 +100,7 @@ template class F, class... U, class... T> struct eval_bound_a } // namespace detail -template class F, class... T> struct mp_bind +BOOST_MP11_EXPORT template class F, class... T> struct mp_bind { #if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, == 1915 ) private: @@ -108,7 +118,7 @@ template class F, class... T> struct mp_bind #endif }; -template using mp_bind_q = mp_bind; +BOOST_MP11_EXPORT template using mp_bind_q = mp_bind; } // namespace mp11 } // namespace boost @@ -117,4 +127,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/config.hpp b/include/boost/mp11/detail/config.hpp index 44686c73..4ecf7e45 100644 --- a/include/boost/mp11/detail/config.hpp +++ b/include/boost/mp11/detail/config.hpp @@ -146,4 +146,10 @@ # define BOOST_MP11_DEPRECATED(msg) #endif +#if defined(BOOST_USE_MODULES) +# define BOOST_MP11_EXPORT export +#else +# define BOOST_MP11_EXPORT +#endif + #endif // #ifndef BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED diff --git a/include/boost/mp11/detail/mp_append.hpp b/include/boost/mp11/detail/mp_append.hpp index 858ee24e..a77efef9 100644 --- a/include/boost/mp11/detail/mp_append.hpp +++ b/include/boost/mp11/detail/mp_append.hpp @@ -307,11 +307,11 @@ struct append_value_lists #if defined(BOOST_MP11_HAS_TEMPLATE_AUTO) -template using mp_append = typename mp_if_c<(sizeof...(L) > 0 && sizeof...(L) == mp_count_if, mp_is_value_list>::value), detail::append_value_lists, detail::append_type_lists>::template fn; +BOOST_MP11_EXPORT template using mp_append = typename mp_if_c<(sizeof...(L) > 0 && sizeof...(L) == mp_count_if, mp_is_value_list>::value), detail::append_value_lists, detail::append_type_lists>::template fn; #else -template using mp_append = detail::append_type_lists::fn; +BOOST_MP11_EXPORT template using mp_append = detail::append_type_lists::fn; #endif diff --git a/include/boost/mp11/detail/mp_copy_if.hpp b/include/boost/mp11/detail/mp_copy_if.hpp index 4edcde09..7d10efc4 100644 --- a/include/boost/mp11/detail/mp_copy_if.hpp +++ b/include/boost/mp11/detail/mp_copy_if.hpp @@ -39,8 +39,8 @@ template class L, class... T, template class P> str } // namespace detail -template class P> using mp_copy_if = typename detail::mp_copy_if_impl::type; -template using mp_copy_if_q = mp_copy_if; +BOOST_MP11_EXPORT template class P> using mp_copy_if = typename detail::mp_copy_if_impl::type; +BOOST_MP11_EXPORT template using mp_copy_if_q = mp_copy_if; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_count.hpp b/include/boost/mp11/detail/mp_count.hpp index bc8aed93..9ca1473f 100644 --- a/include/boost/mp11/detail/mp_count.hpp +++ b/include/boost/mp11/detail/mp_count.hpp @@ -82,7 +82,7 @@ template class L, class... T, class V> struct mp_count_impl using mp_count = typename detail::mp_count_impl::type; +BOOST_MP11_EXPORT template using mp_count = typename detail::mp_count_impl::type; // mp_count_if namespace detail @@ -138,8 +138,8 @@ template class L, class... T, template class P> str } // namespace detail -template class P> using mp_count_if = typename detail::mp_count_if_impl::type; -template using mp_count_if_q = mp_count_if; +BOOST_MP11_EXPORT template class P> using mp_count_if = typename detail::mp_count_if_impl::type; +BOOST_MP11_EXPORT template using mp_count_if_q = mp_count_if; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_defer.hpp b/include/boost/mp11/detail/mp_defer.hpp index 9aaca99e..fa31da2e 100644 --- a/include/boost/mp11/detail/mp_defer.hpp +++ b/include/boost/mp11/detail/mp_defer.hpp @@ -33,8 +33,8 @@ template struct mp_if_c_impl } // namespace detail -template using mp_if_c = typename detail::mp_if_c_impl::type; -template using mp_if = typename detail::mp_if_c_impl(C::value), T, E...>::type; +BOOST_MP11_EXPORT template using mp_if_c = typename detail::mp_if_c_impl::type; +BOOST_MP11_EXPORT template using mp_if = typename detail::mp_if_c_impl(C::value), T, E...>::type; // mp_valid @@ -55,7 +55,7 @@ struct mp_valid_impl>, F, T...>: mp_true {}; } // namespace detail -template class F, class... T> using mp_valid = typename detail::mp_valid_impl; +BOOST_MP11_EXPORT template class F, class... T> using mp_valid = typename detail::mp_valid_impl; #else @@ -73,11 +73,11 @@ template class F, class... T> struct mp_valid_impl } // namespace detail -template class F, class... T> using mp_valid = typename detail::mp_valid_impl::type; +BOOST_MP11_EXPORT template class F, class... T> using mp_valid = typename detail::mp_valid_impl::type; #endif -template using mp_valid_q = mp_valid; +BOOST_MP11_EXPORT template using mp_valid_q = mp_valid; // mp_defer namespace detail @@ -105,11 +105,11 @@ template class F, class... T> struct mp_defer_cuda_workaround #if BOOST_MP11_WORKAROUND( BOOST_MP11_CUDA, >= 9000000 && BOOST_MP11_CUDA < 10000000 ) -template class F, class... T> using mp_defer = typename detail::mp_defer_cuda_workaround< F, T...>::type; +BOOST_MP11_EXPORT template class F, class... T> using mp_defer = typename detail::mp_defer_cuda_workaround< F, T...>::type; #else -template class F, class... T> using mp_defer = mp_if, detail::mp_defer_impl, detail::mp_no_type>; +BOOST_MP11_EXPORT template class F, class... T> using mp_defer = mp_if, detail::mp_defer_impl, detail::mp_no_type>; #endif diff --git a/include/boost/mp11/detail/mp_fold.hpp b/include/boost/mp11/detail/mp_fold.hpp index e2c464c9..b74b80a3 100644 --- a/include/boost/mp11/detail/mp_fold.hpp +++ b/include/boost/mp11/detail/mp_fold.hpp @@ -157,8 +157,8 @@ struct mp_fold_impl, V, F> } // namespace detail -template class F> using mp_fold = typename detail::mp_fold_impl, V, F>::type; -template using mp_fold_q = mp_fold; +BOOST_MP11_EXPORT template class F> using mp_fold = typename detail::mp_fold_impl, V, F>::type; +BOOST_MP11_EXPORT template using mp_fold_q = mp_fold; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_front.hpp b/include/boost/mp11/detail/mp_front.hpp index 53a73ac3..d58b84a9 100644 --- a/include/boost/mp11/detail/mp_front.hpp +++ b/include/boost/mp11/detail/mp_front.hpp @@ -42,7 +42,7 @@ template class L, auto A1, auto... A> struct mp_front_impl using mp_front = typename detail::mp_front_impl::type; +BOOST_MP11_EXPORT template using mp_front = typename detail::mp_front_impl::type; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_is_list.hpp b/include/boost/mp11/detail/mp_is_list.hpp index 25b378bd..77103f76 100644 --- a/include/boost/mp11/detail/mp_is_list.hpp +++ b/include/boost/mp11/detail/mp_is_list.hpp @@ -9,6 +9,7 @@ // http://www.boost.org/LICENSE_1_0.txt #include +#include namespace boost { @@ -31,7 +32,7 @@ template class L, class... T> struct mp_is_list_impl> } // namespace detail -template using mp_is_list = typename detail::mp_is_list_impl::type; +BOOST_MP11_EXPORT template using mp_is_list = typename detail::mp_is_list_impl::type; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_is_value_list.hpp b/include/boost/mp11/detail/mp_is_value_list.hpp index 8f94f030..0ca4c4a1 100644 --- a/include/boost/mp11/detail/mp_is_value_list.hpp +++ b/include/boost/mp11/detail/mp_is_value_list.hpp @@ -33,7 +33,7 @@ template class L, auto... A> struct mp_is_value_list_impl using mp_is_value_list = typename detail::mp_is_value_list_impl::type; +BOOST_MP11_EXPORT template using mp_is_value_list = typename detail::mp_is_value_list_impl::type; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_list.hpp b/include/boost/mp11/detail/mp_list.hpp index 8e8d3e5e..df3c9b4d 100644 --- a/include/boost/mp11/detail/mp_list.hpp +++ b/include/boost/mp11/detail/mp_list.hpp @@ -8,13 +8,15 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt +#include + namespace boost { namespace mp11 { // mp_list -template struct mp_list +BOOST_MP11_EXPORT template struct mp_list { }; diff --git a/include/boost/mp11/detail/mp_list_v.hpp b/include/boost/mp11/detail/mp_list_v.hpp index bc05238a..f3e6d75f 100644 --- a/include/boost/mp11/detail/mp_list_v.hpp +++ b/include/boost/mp11/detail/mp_list_v.hpp @@ -15,7 +15,7 @@ namespace mp11 #if defined(BOOST_MP11_HAS_TEMPLATE_AUTO) // mp_list_v -template struct mp_list_v +BOOST_MP11_EXPORT template struct mp_list_v { }; diff --git a/include/boost/mp11/detail/mp_map_find.hpp b/include/boost/mp11/detail/mp_map_find.hpp index 035538ae..3e9303c1 100644 --- a/include/boost/mp11/detail/mp_map_find.hpp +++ b/include/boost/mp11/detail/mp_map_find.hpp @@ -54,7 +54,7 @@ template class M, class... T, class K> struct mp_map_find_imp } // namespace detail -template using mp_map_find = typename detail::mp_map_find_impl::type; +BOOST_MP11_EXPORT template using mp_map_find = typename detail::mp_map_find_impl::type; #else @@ -111,7 +111,7 @@ template class M, class... T, class K> struct mp_map_find_imp } // namespace detail -template using mp_map_find = typename detail::mp_map_find_impl::type; +BOOST_MP11_EXPORT template using mp_map_find = typename detail::mp_map_find_impl::type; #endif diff --git a/include/boost/mp11/detail/mp_min_element.hpp b/include/boost/mp11/detail/mp_min_element.hpp index 55c21acd..aea8fe53 100644 --- a/include/boost/mp11/detail/mp_min_element.hpp +++ b/include/boost/mp11/detail/mp_min_element.hpp @@ -28,8 +28,8 @@ template class P> struct select_min } // namespace detail -template class P> using mp_min_element = mp_fold_q, mp_first, detail::select_min

>; -template using mp_min_element_q = mp_min_element; +BOOST_MP11_EXPORT template class P> using mp_min_element = mp_fold_q, mp_first, detail::select_min

>; +BOOST_MP11_EXPORT template using mp_min_element_q = mp_min_element; // mp_max_element namespace detail @@ -42,8 +42,8 @@ template class P> struct select_max } // namespace detail -template class P> using mp_max_element = mp_fold_q, mp_first, detail::select_max

>; -template using mp_max_element_q = mp_max_element; +BOOST_MP11_EXPORT template class P> using mp_max_element = mp_fold_q, mp_first, detail::select_max

>; +BOOST_MP11_EXPORT template using mp_max_element_q = mp_max_element; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_plus.hpp b/include/boost/mp11/detail/mp_plus.hpp index 5c9417cd..d6926cc2 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 { @@ -76,7 +76,7 @@ template using mp_plus = typename detail::mp_plus_impl::type; +BOOST_MP11_EXPORT template using mp_plus = typename detail::mp_plus_impl::type; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_remove_if.hpp b/include/boost/mp11/detail/mp_remove_if.hpp index 9687b4a1..32939b6c 100644 --- a/include/boost/mp11/detail/mp_remove_if.hpp +++ b/include/boost/mp11/detail/mp_remove_if.hpp @@ -39,8 +39,8 @@ template class L, class... T, template class P> str } // namespace detail -template class P> using mp_remove_if = typename detail::mp_remove_if_impl::type; -template using mp_remove_if_q = mp_remove_if; +BOOST_MP11_EXPORT template class P> using mp_remove_if = typename detail::mp_remove_if_impl::type; +BOOST_MP11_EXPORT template using mp_remove_if_q = mp_remove_if; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_rename.hpp b/include/boost/mp11/detail/mp_rename.hpp index dde8f6f4..a00c7849 100644 --- a/include/boost/mp11/detail/mp_rename.hpp +++ b/include/boost/mp11/detail/mp_rename.hpp @@ -40,13 +40,13 @@ template class L, auto... A, template class B> struc } // namespace detail -template class B> using mp_rename = typename detail::mp_rename_impl::type; +BOOST_MP11_EXPORT template class B> using mp_rename = typename detail::mp_rename_impl::type; // mp_apply -template class F, class L> using mp_apply = typename detail::mp_rename_impl::type; +BOOST_MP11_EXPORT template class F, class L> using mp_apply = typename detail::mp_rename_impl::type; // mp_apply_q -template using mp_apply_q = typename detail::mp_rename_impl::type; +BOOST_MP11_EXPORT template using mp_apply_q = typename detail::mp_rename_impl::type; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_value.hpp b/include/boost/mp11/detail/mp_value.hpp index d0e59825..3df05e24 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) @@ -15,7 +15,7 @@ namespace boost namespace mp11 { -template using mp_value = std::integral_constant; +BOOST_MP11_EXPORT template using mp_value = std::integral_constant; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_void.hpp b/include/boost/mp11/detail/mp_void.hpp index a7ac7b71..ee0aea65 100644 --- a/include/boost/mp11/detail/mp_void.hpp +++ b/include/boost/mp11/detail/mp_void.hpp @@ -8,6 +8,8 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt +#include + namespace boost { namespace mp11 @@ -24,7 +26,7 @@ template struct mp_void_impl } // namespace detail -template using mp_void = typename detail::mp_void_impl::type; +BOOST_MP11_EXPORT template using mp_void = typename detail::mp_void_impl::type; } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_with_index.hpp b/include/boost/mp11/detail/mp_with_index.hpp index b6932f2d..cf07f5a0 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 @@ -365,13 +365,13 @@ template<> struct mp_with_index_impl_<16> } // namespace detail -template inline BOOST_MP11_CONSTEXPR14 decltype(std::declval()(std::declval>())) mp_with_index( std::size_t i, F && f ) +BOOST_MP11_EXPORT template inline BOOST_MP11_CONSTEXPR14 decltype(std::declval()(std::declval>())) mp_with_index( std::size_t i, F && f ) { assert( i < N ); return detail::mp_with_index_impl_::template call<0>( i, std::forward(f) ); } -template inline BOOST_MP11_CONSTEXPR14 decltype(std::declval()(std::declval>())) mp_with_index( std::size_t i, F && f ) +BOOST_MP11_EXPORT template inline BOOST_MP11_CONSTEXPR14 decltype(std::declval()(std::declval>())) mp_with_index( std::size_t i, F && f ) { return mp_with_index( i, std::forward(f) ); } diff --git a/include/boost/mp11/detail/std/cassert.hpp b/include/boost/mp11/detail/std/cassert.hpp new file mode 100644 index 00000000..a85a7b3a --- /dev/null +++ b/include/boost/mp11/detail/std/cassert.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_MP11_INTERFACE_UNIT +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..3830ca27 --- /dev/null +++ b/include/boost/mp11/detail/std/cstddef.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_MP11_INTERFACE_UNIT +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..6cc0e588 --- /dev/null +++ b/include/boost/mp11/detail/std/tuple.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_MP11_INTERFACE_UNIT +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..ce0adc99 --- /dev/null +++ b/include/boost/mp11/detail/std/type_traits.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_MP11_INTERFACE_UNIT +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..96e1de21 --- /dev/null +++ b/include/boost/mp11/detail/std/utility.hpp @@ -0,0 +1,7 @@ +#ifdef BOOST_USE_MODULES +#ifndef BOOST_MP11_INTERFACE_UNIT +import std; +#endif +#else +#include +#endif diff --git a/include/boost/mp11/function.hpp b/include/boost/mp11/function.hpp index e20b4520..683255c4 100644 --- a/include/boost/mp11/function.hpp +++ b/include/boost/mp11/function.hpp @@ -8,6 +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 +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.mp11; +#endif + +#else + #include #include #include @@ -16,7 +25,7 @@ #include #include #include -#include +#include namespace boost { @@ -36,7 +45,7 @@ template struct mp_and_impl; } // namespace detail -template using mp_and = mp_to_bool< typename detail::mp_and_impl::type >; +BOOST_MP11_EXPORT template using mp_and = mp_to_bool< typename detail::mp_and_impl::type >; namespace detail { @@ -75,7 +84,7 @@ template struct mp_and_impl< mp_list, mp_void.. } // namespace detail -template using mp_and = typename detail::mp_and_impl>::type; +BOOST_MP11_EXPORT template using mp_and = typename detail::mp_and_impl>::type; #endif @@ -83,11 +92,11 @@ template using mp_and = typename detail::mp_and_impl>: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86355 #if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, != 0 ) -template using mp_all = mp_bool< mp_count_if< mp_list, mp_not >::value == 0 >; +BOOST_MP11_EXPORT template using mp_all = mp_bool< mp_count_if< mp_list, mp_not >::value == 0 >; #else -template using mp_all = mp_bool< mp_count< mp_list...>, mp_false >::value == 0 >; +BOOST_MP11_EXPORT template using mp_all = mp_bool< mp_count< mp_list...>, mp_false >::value == 0 >; #endif @@ -99,7 +108,7 @@ template struct mp_or_impl; } // namespace detail -template using mp_or = mp_to_bool< typename detail::mp_or_impl::type >; +BOOST_MP11_EXPORT template using mp_or = mp_to_bool< typename detail::mp_or_impl::type >; namespace detail { @@ -125,11 +134,11 @@ template struct mp_or_impl // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86356 #if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, != 0 ) -template using mp_any = mp_bool< mp_count_if< mp_list, mp_to_bool >::value != 0 >; +BOOST_MP11_EXPORT template using mp_any = mp_bool< mp_count_if< mp_list, mp_to_bool >::value != 0 >; #else -template using mp_any = mp_bool< mp_count< mp_list...>, mp_true >::value != 0 >; +BOOST_MP11_EXPORT template using mp_any = mp_bool< mp_count< mp_list...>, mp_true >::value != 0 >; #endif @@ -151,7 +160,7 @@ template struct mp_same_impl } // namespace detail -template using mp_same = typename detail::mp_same_impl::type; +BOOST_MP11_EXPORT template using mp_same = typename detail::mp_same_impl::type; // mp_similar namespace detail @@ -196,7 +205,7 @@ template struct mp_similar_impl using mp_similar = typename detail::mp_similar_impl::type; +BOOST_MP11_EXPORT template using mp_similar = typename detail::mp_similar_impl::type; #if BOOST_MP11_GCC # pragma GCC diagnostic push @@ -204,19 +213,21 @@ template using mp_similar = typename detail::mp_similar_impl:: #endif // mp_less -template using mp_less = mp_bool<(T1::value < 0 && T2::value >= 0) || ((T1::value < T2::value) && !(T1::value >= 0 && T2::value < 0))>; +BOOST_MP11_EXPORT template using mp_less = mp_bool<(T1::value < 0 && T2::value >= 0) || ((T1::value < T2::value) && !(T1::value >= 0 && T2::value < 0))>; #if BOOST_MP11_GCC # pragma GCC diagnostic pop #endif // mp_min -template using mp_min = mp_min_element, mp_less>; +BOOST_MP11_EXPORT template using mp_min = mp_min_element, mp_less>; // mp_max -template using mp_max = mp_max_element, mp_less>; +BOOST_MP11_EXPORT template using mp_max = mp_max_element, mp_less>; } // 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..a7d9db8e 100644 --- a/include/boost/mp11/integer_sequence.hpp +++ b/include/boost/mp11/integer_sequence.hpp @@ -8,8 +8,18 @@ // 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 +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.mp11; +#endif + +#else + #include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -28,13 +38,13 @@ namespace mp11 { // integer_sequence -template struct integer_sequence +BOOST_MP11_EXPORT template struct integer_sequence { }; #if defined(BOOST_MP11_HAS_MAKE_INTEGER_SEQ) -template using make_integer_sequence = __make_integer_seq; +BOOST_MP11_EXPORT template using make_integer_sequence = __make_integer_seq; #else @@ -98,18 +108,18 @@ template struct make_integer_sequence_impl: iseq_if_c using make_integer_sequence = typename detail::make_integer_sequence_impl::type; +BOOST_MP11_EXPORT template using make_integer_sequence = typename detail::make_integer_sequence_impl::type; #endif // defined(BOOST_MP11_HAS_MAKE_INTEGER_SEQ) // index_sequence -template using index_sequence = integer_sequence; +BOOST_MP11_EXPORT template using index_sequence = integer_sequence; // make_index_sequence -template using make_index_sequence = make_integer_sequence; +BOOST_MP11_EXPORT template using make_index_sequence = make_integer_sequence; // index_sequence_for -template using index_sequence_for = make_integer_sequence; +BOOST_MP11_EXPORT template using index_sequence_for = make_integer_sequence; } // namespace mp11 } // namespace boost @@ -118,4 +128,6 @@ template using index_sequence_for = make_integer_sequence +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.mp11; +#endif + +#else + #include #include -#include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -24,22 +33,22 @@ namespace mp11 { // mp_bool -template using mp_bool = std::integral_constant; +BOOST_MP11_EXPORT template using mp_bool = std::integral_constant; -using mp_true = mp_bool; -using mp_false = mp_bool; +BOOST_MP11_EXPORT using mp_true = mp_bool; +BOOST_MP11_EXPORT using mp_false = mp_bool; // mp_to_bool -template using mp_to_bool = mp_bool( T::value )>; +BOOST_MP11_EXPORT template using mp_to_bool = mp_bool( T::value )>; // mp_not -template using mp_not = mp_bool< !T::value >; +BOOST_MP11_EXPORT template using mp_not = mp_bool< !T::value >; // mp_int -template using mp_int = std::integral_constant; +BOOST_MP11_EXPORT template using mp_int = std::integral_constant; // mp_size_t -template using mp_size_t = std::integral_constant; +BOOST_MP11_EXPORT template using mp_size_t = std::integral_constant; } // namespace mp11 } // namespace boost @@ -48,4 +57,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..4f9937a2 100644 --- a/include/boost/mp11/lambda.hpp +++ b/include/boost/mp11/lambda.hpp @@ -8,6 +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 +#ifndef BOOST_IN_MODULE_PURVIEW +import boost.mp11; +#endif + +#else + #include #if BOOST_MP11_WORKAROUND(BOOST_MP11_MSVC, <= 1800) @@ -17,8 +26,8 @@ #else #include -#include -#include +#include +#include #if defined(_MSC_VER) || defined(__GNUC__) # pragma push_macro( "I" ) @@ -37,7 +46,7 @@ template struct lambda_impl; } // namespace detail // mp_lambda -template using mp_lambda = typename detail::lambda_impl::type; +BOOST_MP11_EXPORT template using mp_lambda = typename detail::lambda_impl::type; namespace detail { @@ -196,4 +205,6 @@ template