mirror of
https://github.com/boostorg/compat.git
synced 2026-01-21 04:42:38 +00:00
Compare commits
8 Commits
boost-1.90
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7098ce569 | ||
|
|
96ec9c1b89 | ||
|
|
945b2862b4 | ||
|
|
fbad5e0834 | ||
|
|
7ce75ac955 | ||
|
|
0776d62a95 | ||
|
|
904b80b8a1 | ||
|
|
ffaadc079d |
@@ -34,7 +34,6 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch
|
||||
'set -e',
|
||||
'uname -a',
|
||||
'echo $DRONE_STAGE_MACHINE',
|
||||
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
|
||||
] +
|
||||
(if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
|
||||
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
|
||||
@@ -160,31 +159,24 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 32 ASAN",
|
||||
"Linux 24.04 GCC 14 32/64 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan,
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + asan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 64 ASAN",
|
||||
"Linux 24.04 GCC 14 32/64 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan,
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 32 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + ubsan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 64 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + ubsan,
|
||||
"g++-14-multilib",
|
||||
"Linux 25.10 GCC 15 32/64",
|
||||
"cppalliance/droneubuntu2510:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c', ADDRMD: '32,64' },
|
||||
"g++-15-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
@@ -202,40 +194,47 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 17 UBSAN",
|
||||
"Linux 24.04 Clang 17",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan,
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' },
|
||||
"clang-17",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 17 ASAN",
|
||||
"Linux 24.04 Clang 18",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan,
|
||||
"clang-17",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan,
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' },
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 ASAN",
|
||||
"Linux 24.04 Clang 19",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan,
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.10 Clang 19",
|
||||
"cppalliance/droneubuntu2410:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '11,14,17,20,2b' },
|
||||
"clang-19",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 20 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
|
||||
"clang-20",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 20 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + asan,
|
||||
"clang-20",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 25.10 Clang 21",
|
||||
"cppalliance/droneubuntu2510:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '11,14,17,20,23,2c' },
|
||||
"clang-21",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 10.15 Xcode 12.2 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,1z' } + ubsan,
|
||||
@@ -258,6 +257,18 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 14 Xcode 16.2.0 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
xcode_version = "16.2.0", osx_version = "sonoma", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 14 Xcode 16.2.0 ASAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
xcode_version = "16.2.0", osx_version = "sonoma", arch = "arm64",
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2015 msvc-14.0",
|
||||
"cppalliance/dronevs2015",
|
||||
@@ -281,4 +292,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
"cppalliance/dronevs2022:1",
|
||||
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2026 msvc-14.5",
|
||||
"cppalliance/dronevs2026:1",
|
||||
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' },
|
||||
),
|
||||
]
|
||||
|
||||
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -183,18 +183,24 @@ jobs:
|
||||
- toolset: clang
|
||||
compiler: clang++-20
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
container: ubuntu:25.04
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: clang-20
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-13
|
||||
compiler: clang++-21
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
container: ubuntu:25.10
|
||||
os: ubuntu-latest
|
||||
install: clang-21
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-14
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
os: macos-15
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
@@ -321,9 +327,9 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
- os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
@@ -370,9 +376,9 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
- os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
@@ -429,9 +435,9 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
- os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ https://www.boost.org/LICENSE_1_0.txt
|
||||
## Changes in 1.90.0
|
||||
|
||||
* Added `to_underlying.hpp` (contributed by Braden Ganetsky.)
|
||||
* Extracted `nontype_t` to its own public header `nontype.hpp` and added `nontype`.
|
||||
|
||||
## Changes in 1.89.0
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@ for (auto fn : fns) {
|
||||
## Synopsis
|
||||
|
||||
```cpp
|
||||
#include <boost/compat/nontype.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace compat
|
||||
|
||||
@@ -12,7 +12,6 @@ include::invoke.adoc[]
|
||||
include::latch.adoc[]
|
||||
include::mem_fn.adoc[]
|
||||
include::move_only_function.adoc[]
|
||||
include::nontype.adoc[]
|
||||
include::shared_lock.adoc[]
|
||||
include::to_array.adoc[]
|
||||
include::to_underlying.adoc[]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/compat/nontype.hpp>
|
||||
#include <boost/compat/detail/nontype.hpp>
|
||||
#include <boost/compat/invoke.hpp>
|
||||
#include <boost/compat/type_traits.hpp>
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ bool is_nullary_arg( F f )
|
||||
template<bool NoEx, class R, class ...Args>
|
||||
struct mo_invoke_function_holder
|
||||
{
|
||||
static R invoke_function( storage s, Args&&... args) noexcept( NoEx )
|
||||
static R invoke_function( storage const& s, Args&&... args) noexcept( NoEx )
|
||||
{
|
||||
auto f = reinterpret_cast<R(*)( Args... )>( s.pfn_ );
|
||||
return compat::invoke_r<R>( f, std::forward<Args>( args )... );
|
||||
@@ -257,7 +257,7 @@ struct mo_invoke_function_holder
|
||||
template<ref_quals RQ, bool Const, bool NoEx, class F, class R, class ...Args>
|
||||
struct mo_invoke_object_holder
|
||||
{
|
||||
static R invoke_object( storage s, Args&&... args ) noexcept( NoEx )
|
||||
static R invoke_object( storage const& s, Args&&... args ) noexcept( NoEx )
|
||||
{
|
||||
using T = remove_reference_t<F>;
|
||||
using cv_T = conditional_t<Const, add_const_t<T>, T>;
|
||||
@@ -274,7 +274,7 @@ struct mo_invoke_object_holder
|
||||
template<ref_quals RQ, bool Const, bool NoEx, class F, class R, class ...Args>
|
||||
struct mo_invoke_local_holder
|
||||
{
|
||||
static R invoke_local( storage s, Args&&... args ) noexcept( NoEx )
|
||||
static R invoke_local( storage const& s, Args&&... args ) noexcept( NoEx )
|
||||
{
|
||||
using T = remove_reference_t<F>;
|
||||
using cv_T = conditional_t<Const, add_const_t<T>, T>;
|
||||
@@ -285,7 +285,7 @@ struct mo_invoke_local_holder
|
||||
>
|
||||
>;
|
||||
|
||||
return compat::invoke_r<R>( static_cast<cv_ref_T>( *static_cast<cv_T*>( s.addr() ) ), std::forward<Args>( args )... );
|
||||
return compat::invoke_r<R>( static_cast<cv_ref_T>( *static_cast<cv_T*>( const_cast<storage&>( s ).addr() ) ), std::forward<Args>( args )... );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -485,9 +485,9 @@ struct move_only_function_base
|
||||
|
||||
detail::storage s_;
|
||||
#if defined(__cpp_noexcept_function_type)
|
||||
R ( *invoke_ )( detail::storage, Args&&... ) noexcept( NoEx ) = nullptr;
|
||||
R ( *invoke_ )( detail::storage const&, Args&&... ) noexcept( NoEx ) = nullptr;
|
||||
#else
|
||||
R ( *invoke_ )( detail::storage, Args&&... ) = nullptr;
|
||||
R ( *invoke_ )( detail::storage const&, Args&&... ) = nullptr;
|
||||
#endif
|
||||
void ( *manager_ )( op_type, detail::storage&, detail::storage* ) = &manage_empty;
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ int main()
|
||||
BOOST_TEST_EQ( boost::compat::bind_back( &X::m, &x )(), -1 );
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||
|
||||
{
|
||||
BOOST_TEST_EQ( boost::compat::bind_back( &X::m, Y() )(), -1 );
|
||||
|
||||
@@ -39,7 +39,7 @@ int main()
|
||||
BOOST_TEST_EQ( boost::compat::bind_front( &X::m, &x )(), -1 );
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||
|
||||
{
|
||||
BOOST_TEST_EQ( boost::compat::bind_front( &X::m, Y() )(), -1 );
|
||||
|
||||
@@ -29,7 +29,7 @@ int main()
|
||||
BOOST_TEST_EQ( boost::compat::invoke( &X::m, &x ), -1 );
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||
{
|
||||
BOOST_TEST_EQ( boost::compat::invoke( &X::m, Y() ), -1 );
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ int main()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||
{
|
||||
constexpr Y y = {};
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -845,11 +846,39 @@ static void test_conv()
|
||||
}
|
||||
}
|
||||
|
||||
static void test_mutable_lambda()
|
||||
{
|
||||
{
|
||||
// Within SBO limits.
|
||||
int captured = 0;
|
||||
move_only_function<int()> func = [captured]() mutable { return ++captured; };
|
||||
|
||||
BOOST_TEST_EQ( func(), 1 );
|
||||
BOOST_TEST_EQ( func(), 2 );
|
||||
|
||||
move_only_function<int()> func2(std::move(func));
|
||||
BOOST_TEST_EQ( func2(), 3 );
|
||||
}
|
||||
|
||||
{
|
||||
// Too large for SBO.
|
||||
std::array<std::uint8_t, 256> captured = {{}};
|
||||
move_only_function<int()> func = [captured]() mutable { return ++captured[0]; };
|
||||
|
||||
BOOST_TEST_EQ( func(), 1 );
|
||||
BOOST_TEST_EQ( func(), 2 );
|
||||
|
||||
move_only_function<int()> func2(std::move(func));
|
||||
BOOST_TEST_EQ( func2(), 3 );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_call();
|
||||
test_traits();
|
||||
test_conv();
|
||||
test_mutable_lambda();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/compat/nontype.hpp>
|
||||
#include <boost/compat/detail/nontype.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
Reference in New Issue
Block a user