Compare commits

...

9 Commits

7 changed files with 271 additions and 50 deletions

View File

@ -19,27 +19,30 @@ jobs:
include:
- toolset: gcc-4.8
cxxstd: "03,11"
os: ubuntu-18.04
os: ubuntu-latest
container: ubuntu:18.04
install: g++-4.8-multilib
address-model: 32,64
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
os: ubuntu-latest
container: ubuntu:18.04
install: g++-5-multilib
address-model: 32,64
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
os: ubuntu-latest
container: ubuntu:18.04
install: g++-6-multilib
address-model: 32,64
- toolset: gcc-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
os: ubuntu-20.04
install: g++-7-multilib
address-model: 32,64
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
os: ubuntu-20.04
install: g++-8-multilib
address-model: 32,64
- toolset: gcc-9
@ -65,27 +68,30 @@ jobs:
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-18.04
os: ubuntu-latest
container: ubuntu:18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-18.04
os: ubuntu-latest
container: ubuntu:18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
os: ubuntu-latest
container: ubuntu:18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-18.04
os: ubuntu-20.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
os: ubuntu-20.04
install: clang-7
- toolset: clang
compiler: clang++-8
@ -130,15 +136,31 @@ jobs:
- toolset: clang
cxxstd: "03,11,14,17,20,2b"
os: macos-12
- toolset: clang
cxxstd: "03,11,14,17,20,2b"
os: macos-13
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python git g++
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
run: |
sudo apt-get update
sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
@ -249,7 +271,7 @@ jobs:
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
@ -296,7 +318,7 @@ jobs:
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
@ -353,7 +375,7 @@ jobs:
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
@ -390,3 +412,183 @@ jobs:
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error
windows-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
- os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- 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%
- name: Use library with add_subdirectory (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use library with add_subdirectory (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
windows-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
- os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- 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%
- name: Configure
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
- name: Install (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Debug
- name: Install (Release)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Release
- name: Use the installed library (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use the installed library (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
windows-cmake-test:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
- os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- 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%
- name: Configure
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON ..
- name: Build tests (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target tests --config Debug
- name: Run tests (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error -C Debug
- name: Build tests (Release)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target tests --config Release
- name: Run tests (Release)
shell: cmd
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error -C Release

View File

@ -20,7 +20,6 @@ target_link_libraries(boost_function
Boost::core
Boost::preprocessor
Boost::throw_exception
Boost::type_index
Boost::type_traits
Boost::typeof
)

View File

@ -9,6 +9,7 @@
#ifndef BOOST_FUNCTION_PROLOGUE_HPP
#define BOOST_FUNCTION_PROLOGUE_HPP
# include <boost/function/detail/requires_cxx11.hpp>
# include <cassert>
# include <algorithm>
# include <boost/config/no_tr1/functional.hpp> // unary_function, binary_function

View File

@ -0,0 +1,22 @@
#ifndef BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
#define BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
// Copyright 2023 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
defined(BOOST_NO_CXX11_DECLTYPE) || \
defined(BOOST_NO_CXX11_CONSTEXPR) || \
defined(BOOST_NO_CXX11_NOEXCEPT) || \
defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.84. Please open an issue in https://github.com/boostorg/function if you want it retained.")
#endif
#endif // #ifndef BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED

View File

@ -11,30 +11,27 @@
#ifndef BOOST_FUNCTION_BASE_HEADER
#define BOOST_FUNCTION_BASE_HEADER
#include <stdexcept>
#include <string>
#include <memory>
#include <new>
#include <boost/config.hpp>
#include <boost/assert.hpp>
#include <boost/type_index.hpp>
#include <boost/function/function_fwd.hpp>
#include <boost/function_equal.hpp>
#include <boost/core/typeinfo.hpp>
#include <boost/core/ref.hpp>
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/composite_traits.hpp>
#include <boost/ref.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/config/workaround.hpp>
#include <boost/type_traits/alignment_of.hpp>
#ifndef BOOST_NO_SFINAE
#include <boost/type_traits/enable_if.hpp>
#else
#include <boost/type_traits/integral_constant.hpp>
#endif
#include <boost/function_equal.hpp>
#include <boost/function/function_fwd.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <stdexcept>
#include <string>
#include <memory>
#include <new>
#if defined(BOOST_MSVC)
# pragma warning( push )
@ -73,7 +70,7 @@ namespace boost {
// For pointers to std::type_info objects
struct type_t {
// (get_functor_type_tag, check_functor_type_tag).
const boost::typeindex::type_info* type;
const boost::core::typeinfo* type;
// Whether the type is const-qualified.
bool const_qualified;
@ -203,7 +200,7 @@ namespace boost {
{
// Check whether we have the same type. We can add
// cv-qualifiers, but we can't take them away.
if (*out_buffer.members.type.type == boost::typeindex::type_id<F>()
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(F)
&& (!in_buffer.members.obj_ref.is_const_qualified
|| out_buffer.members.type.const_qualified)
&& (!in_buffer.members.obj_ref.is_volatile_qualified
@ -215,7 +212,7 @@ namespace boost {
return;
case get_functor_type_tag:
out_buffer.members.type.type = &boost::typeindex::type_id<F>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(F);
out_buffer.members.type.const_qualified = in_buffer.members.obj_ref.is_const_qualified;
out_buffer.members.type.volatile_qualified = in_buffer.members.obj_ref.is_volatile_qualified;
return;
@ -275,12 +272,12 @@ namespace boost {
} else if (op == destroy_functor_tag)
out_buffer.members.func_ptr = 0;
else if (op == check_functor_type_tag) {
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
out_buffer.members.obj_ptr = &in_buffer.members.func_ptr;
else
out_buffer.members.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
out_buffer.members.type.const_qualified = false;
out_buffer.members.type.volatile_qualified = false;
}
@ -307,12 +304,12 @@ namespace boost {
(void)f; // suppress warning about the value of f not being used (MSVC)
f->~Functor();
} else if (op == check_functor_type_tag) {
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
out_buffer.members.obj_ptr = in_buffer.data;
else
out_buffer.members.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
out_buffer.members.type.const_qualified = false;
out_buffer.members.type.volatile_qualified = false;
}
@ -366,12 +363,12 @@ namespace boost {
delete f;
out_buffer.members.obj_ptr = 0;
} else if (op == check_functor_type_tag) {
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
out_buffer.members.obj_ptr = in_buffer.members.obj_ptr;
else
out_buffer.members.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
out_buffer.members.type.const_qualified = false;
out_buffer.members.type.volatile_qualified = false;
}
@ -405,7 +402,7 @@ namespace boost {
{
typedef typename get_function_tag<functor_type>::type tag_type;
if (op == get_functor_type_tag) {
out_buffer.members.type.type = &boost::typeindex::type_id<functor_type>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(functor_type);
out_buffer.members.type.const_qualified = false;
out_buffer.members.type.volatile_qualified = false;
} else {
@ -484,12 +481,12 @@ namespace boost {
wrapper_allocator.deallocate(victim,1);
out_buffer.members.obj_ptr = 0;
} else if (op == check_functor_type_tag) {
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
out_buffer.members.obj_ptr = in_buffer.members.obj_ptr;
else
out_buffer.members.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
out_buffer.members.type.const_qualified = false;
out_buffer.members.type.volatile_qualified = false;
}
@ -515,7 +512,7 @@ namespace boost {
{
typedef typename get_function_tag<functor_type>::type tag_type;
if (op == get_functor_type_tag) {
out_buffer.members.type.type = &boost::typeindex::type_id<functor_type>().type_info();
out_buffer.members.type.type = &BOOST_CORE_TYPEID(functor_type);
out_buffer.members.type.const_qualified = false;
out_buffer.members.type.volatile_qualified = false;
} else {
@ -615,9 +612,9 @@ public:
/** Retrieve the type of the stored function object, or type_id<void>()
if this is empty. */
const boost::typeindex::type_info& target_type() const
const boost::core::typeinfo& target_type() const
{
if (!vtable) return boost::typeindex::type_id<void>().type_info();
if (!vtable) return BOOST_CORE_TYPEID(void);
detail::function::function_buffer type;
get_vtable()->manager(functor, type, detail::function::get_functor_type_tag);
@ -630,7 +627,7 @@ public:
if (!vtable) return 0;
detail::function::function_buffer type_result;
type_result.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
type_result.members.type.type = &BOOST_CORE_TYPEID(Functor);
type_result.members.type.const_qualified = is_const<Functor>::value;
type_result.members.type.volatile_qualified = is_volatile<Functor>::value;
get_vtable()->manager(functor, type_result,
@ -644,7 +641,7 @@ public:
if (!vtable) return 0;
detail::function::function_buffer type_result;
type_result.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
type_result.members.type.type = &BOOST_CORE_TYPEID(Functor);
type_result.members.type.const_qualified = true;
type_result.members.type.volatile_qualified = is_volatile<Functor>::value;
get_vtable()->manager(functor, type_result,

View File

@ -86,3 +86,7 @@ run quick.cpp ;
compile issue_42.cpp ;
run fn_eq_bind_test.cpp ;
# /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti
run contains_test.cpp : : : <rtti>off <toolset>gcc-4.4,<cxxstd>0x:<build>no : contains_test_no_rtti ;
run contains2_test.cpp : : : <rtti>off <toolset>gcc-4.4,<cxxstd>0x:<build>no : contains2_test_no_rtti ;

View File

@ -18,16 +18,12 @@ config
core
preprocessor
throw_exception
type_index
type_traits
typeof
# Secondary dependencies
static_assert
container_hash
describe
mp11
)
foreach(dep IN LISTS deps)