forked from boostorg/core
Compare commits
46 Commits
feature/is
...
feature/st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92f6cfb3cc | ||
|
|
ed452c57a3 | ||
|
|
78885aab8e | ||
|
|
8ebe2e7f57 | ||
|
|
32e6c30f4b | ||
|
|
cebfe007e8 | ||
|
|
3e16f3df14 | ||
|
|
e3a2e88e4c | ||
|
|
5e451b6c84 | ||
|
|
88a957b21c | ||
|
|
1bac0ccfd1 | ||
|
|
602961e526 | ||
|
|
366802b43c | ||
|
|
9dd0a8e1e4 | ||
|
|
622476533c | ||
|
|
a09ee19e3e | ||
|
|
040b018ce0 | ||
|
|
42d0c5954a | ||
|
|
76d0f22d3b | ||
|
|
243eec26fe | ||
|
|
44c32d7691 | ||
|
|
0ee7dc5910 | ||
|
|
9e9e6e3898 | ||
|
|
242b14bb69 | ||
|
|
76061d91d4 | ||
|
|
bda05a7812 | ||
|
|
d66b8c1c13 | ||
|
|
bd29e0dd15 | ||
|
|
72761e34e0 | ||
|
|
983234baee | ||
|
|
83a3a51bee | ||
|
|
acbeaae181 | ||
|
|
d01b4e94cc | ||
|
|
e22bd49fa7 | ||
|
|
c056f3dfc9 | ||
|
|
8b8944dd6e | ||
|
|
278d3f0060 | ||
|
|
a8c757ddf2 | ||
|
|
98a055cf34 | ||
|
|
074a467d9d | ||
|
|
0a238bb30d | ||
|
|
b18495fe35 | ||
|
|
151d0c4143 | ||
|
|
25b0defdeb | ||
|
|
541745ea24 | ||
|
|
5f825106c7 |
@@ -32,6 +32,8 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch
|
||||
commands:
|
||||
[
|
||||
'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 []) +
|
||||
@@ -200,31 +202,37 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.04 GCC 13 32 ASAN",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + asan,
|
||||
"g++-13-multilib",
|
||||
"Linux 24.04 GCC 13* 32/64",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.04 GCC 13 64 ASAN",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan,
|
||||
"g++-13-multilib",
|
||||
"Linux 24.04 GCC 14 32 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + asan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.04 GCC 13 32 UBSAN",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + ubsan,
|
||||
"g++-13-multilib",
|
||||
"Linux 24.04 GCC 14 64 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.04 GCC 13 64 UBSAN",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + ubsan,
|
||||
"g++-13-multilib",
|
||||
"Linux 24.04 GCC 14 32 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,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: '03,11,14,17,20,2b', ADDRMD: '64' } + ubsan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
@@ -347,24 +355,38 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.04 Clang 16",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
"Linux 24.04 Clang 16",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-16",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.10 Clang 17 UBSAN",
|
||||
"cppalliance/droneubuntu2310:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
"Linux 24.04 Clang 17",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-17",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.10 Clang 17 ASAN",
|
||||
"cppalliance/droneubuntu2310:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
"clang-17",
|
||||
"Linux 24.04 Clang 18 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.10 Clang 19",
|
||||
"cppalliance/droneubuntu2410:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-19",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
|
||||
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@@ -128,6 +128,13 @@ jobs:
|
||||
container: ubuntu:23.04
|
||||
install:
|
||||
- g++-13-multilib
|
||||
- toolset: gcc-14
|
||||
cxxstd: "03,11,14,17,20,23"
|
||||
address-model: 32,64
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:24.04
|
||||
install:
|
||||
- g++-14-multilib
|
||||
- name: UBSAN
|
||||
toolset: gcc-12
|
||||
cxxstd: "03,11,14,17,20,23"
|
||||
@@ -286,15 +293,23 @@ jobs:
|
||||
- toolset: clang
|
||||
compiler: clang++-17
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: ubuntu-22.04
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:23.10
|
||||
install:
|
||||
- clang-17
|
||||
- libc++-17-dev
|
||||
- libc++abi-17-dev
|
||||
sources:
|
||||
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
|
||||
source_keys:
|
||||
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
|
||||
cxxflags: -stdlib=libc++
|
||||
linkflags: -stdlib=libc++
|
||||
- toolset: clang
|
||||
compiler: clang++-18
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:24.04
|
||||
install:
|
||||
- clang-18
|
||||
- libc++-18-dev
|
||||
- libc++abi-18-dev
|
||||
cxxflags: -stdlib=libc++
|
||||
linkflags: -stdlib=libc++
|
||||
- name: UBSAN
|
||||
@@ -310,15 +325,15 @@ jobs:
|
||||
- libc++-15-dev
|
||||
- libc++abi-15-dev
|
||||
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-12
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-13
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-14
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-15
|
||||
|
||||
timeout-minutes: 45
|
||||
runs-on: ${{matrix.os}}
|
||||
@@ -611,9 +626,10 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-12
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
timeout-minutes: 10
|
||||
@@ -678,9 +694,10 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-12
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
timeout-minutes: 10
|
||||
@@ -755,9 +772,10 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-12
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
timeout-minutes: 20
|
||||
|
||||
23
build.jam
Normal file
23
build.jam
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright 2023-2024 René Ferdinand Rivera Morell
|
||||
# Copyright 2024 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
require-b2 5.2 ;
|
||||
|
||||
constant boost_dependencies :
|
||||
/boost/assert//boost_assert
|
||||
/boost/config//boost_config
|
||||
/boost/static_assert//boost_static_assert
|
||||
/boost/throw_exception//boost_throw_exception
|
||||
;
|
||||
|
||||
project /boost/core ;
|
||||
|
||||
explicit
|
||||
[ alias boost_core : : : : <include>include <library>$(boost_dependencies) ]
|
||||
[ alias all : boost_core test ]
|
||||
;
|
||||
|
||||
call-if : boost-library core
|
||||
;
|
||||
@@ -9,7 +9,7 @@ import project ;
|
||||
import doxygen ;
|
||||
import quickbook ;
|
||||
|
||||
path-constant INCLUDES : ../../.. ;
|
||||
path-constant INCLUDES : ../include ;
|
||||
|
||||
doxygen ref_reference
|
||||
:
|
||||
|
||||
@@ -7,12 +7,24 @@
|
||||
|
||||
[section Revision History]
|
||||
|
||||
[section Changes in 1.86.0]
|
||||
|
||||
* Added a [link core.pointer_in_range `boost/core/pointer_in_range.hpp`] header with a `pointer_in_range`
|
||||
function template to check if a pointer is within a given range.
|
||||
* Fixed `type_name` for abstract classes. ([github_issue 172])
|
||||
* Fixed `boost/core/type_name.hpp` compilation error with MSVC with disabled native `wchar_t` type.
|
||||
([github_issue 173])
|
||||
* Added a workaround for an MSVC [@https://developercommunity.visualstudio.com/t/Compiler-bug:-Incorrect-C2247-and-C2248/10690025 bug]
|
||||
causing `empty_value` compilation errors when it is used with a nested class. ([github_pr 175])
|
||||
|
||||
[endsect]
|
||||
|
||||
[section Changes in 1.85.0]
|
||||
|
||||
* Added a new [link core.functor `boost/core/functor.hpp`] header with a `functor` class template
|
||||
for wrapping a raw function into a function object class.
|
||||
* Changed [link core.null_deleter `null_deleter`], [link core.fclose_deleter `fclose_deleter`]
|
||||
and [link.checked_delete checked deleter] definitions so that they don't bring namespace `boost`
|
||||
and [link core.checked_delete checked deleter] definitions so that they don't bring namespace `boost`
|
||||
into argument-dependent lookup in cases like this:
|
||||
```
|
||||
std::unique_ptr< std::FILE, boost::fclose_deleter > p1, p2;
|
||||
|
||||
@@ -20,6 +20,9 @@ or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
]
|
||||
]
|
||||
|
||||
[template github_issue[key]'''<ulink url="https://github.com/boostorg/core/issues/'''[key]'''">#'''[key]'''</ulink>''']
|
||||
[template github_pr[key]'''<ulink url="https://github.com/boostorg/core/pull/'''[key]'''">PR#'''[key]'''</ulink>''']
|
||||
|
||||
[template simplesect[title]
|
||||
[block '''<simplesect><title>'''[title]'''</title>''']]
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@ namespace boost
|
||||
// forward declaration of boost::basic_string_view from Utility
|
||||
template<class Ch, class Tr> class basic_string_view;
|
||||
|
||||
// forward declaration of boost::hash_range from ContainerHash
|
||||
template<class It> std::size_t hash_range( It, It );
|
||||
|
||||
namespace core
|
||||
{
|
||||
namespace detail
|
||||
@@ -1181,11 +1178,6 @@ public:
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline friend std::size_t hash_value( basic_string_view const& sv )
|
||||
{
|
||||
return boost::hash_range( sv.begin(), sv.end() );
|
||||
}
|
||||
};
|
||||
|
||||
// stream inserter
|
||||
|
||||
@@ -95,9 +95,57 @@ private:
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if defined(BOOST_MSVC)
|
||||
/*
|
||||
This is a workaround to an MSVC bug when T is a nested class:
|
||||
https://developercommunity.visualstudio.com/t/Compiler-bug:-Incorrect-C2247-and-C2248/10690025
|
||||
*/
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
class empty_value_base
|
||||
: public T {
|
||||
public:
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
empty_value_base() = default;
|
||||
#else
|
||||
BOOST_CONSTEXPR empty_value_base() { }
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class U, class... Args>
|
||||
BOOST_CONSTEXPR empty_value_base(U&& value, Args&&... args)
|
||||
: T(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value_base(U&& value)
|
||||
: T(std::forward<U>(value)) { }
|
||||
#endif
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value_base(const U& value)
|
||||
: T(value) { }
|
||||
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value_base(U& value)
|
||||
: T(value) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
#endif
|
||||
|
||||
template<class T, unsigned N>
|
||||
class empty_value<T, N, true>
|
||||
#if defined(BOOST_MSVC)
|
||||
: detail::empty_value_base<T> {
|
||||
typedef detail::empty_value_base<T> empty_base_;
|
||||
#else
|
||||
: T {
|
||||
typedef T empty_base_;
|
||||
#endif
|
||||
|
||||
public:
|
||||
typedef T type;
|
||||
|
||||
@@ -108,26 +156,26 @@ public:
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t)
|
||||
: T() { }
|
||||
: empty_base_() { }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class U, class... Args>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, U&& value, Args&&... args)
|
||||
: T(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
: empty_base_(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, U&& value)
|
||||
: T(std::forward<U>(value)) { }
|
||||
: empty_base_(std::forward<U>(value)) { }
|
||||
#endif
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, const U& value)
|
||||
: T(value) { }
|
||||
: empty_base_(value) { }
|
||||
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, U& value)
|
||||
: T(value) { }
|
||||
: empty_base_(value) { }
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR const T& get() const BOOST_NOEXCEPT {
|
||||
|
||||
@@ -8,17 +8,6 @@ if(HAVE_BOOST_TEST)
|
||||
|
||||
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::core Boost::static_assert Boost::type_traits)
|
||||
|
||||
set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::type_traits)
|
||||
|
||||
boost_test(TYPE run SOURCES eif_constructors.cpp)
|
||||
boost_test(TYPE run SOURCES eif_dummy_arg_disambiguation.cpp)
|
||||
boost_test(TYPE run SOURCES eif_lazy.cpp)
|
||||
boost_test(TYPE run SOURCES eif_lazy_test.cpp)
|
||||
boost_test(TYPE run SOURCES eif_member_templates.cpp)
|
||||
boost_test(TYPE run SOURCES eif_namespace_disambiguation.cpp)
|
||||
boost_test(TYPE run SOURCES eif_no_disambiguation.cpp)
|
||||
boost_test(TYPE run SOURCES eif_partial_specializations.cpp)
|
||||
|
||||
set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::throw_exception)
|
||||
|
||||
boost_test(TYPE run SOURCES no_exceptions_support_test.cpp)
|
||||
@@ -27,6 +16,10 @@ set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::utility)
|
||||
|
||||
boost_test(TYPE run SOURCES sv_conversion_test2.cpp)
|
||||
|
||||
set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::container_hash)
|
||||
|
||||
boost_test(TYPE run SOURCES sv_hash_test.cpp)
|
||||
|
||||
set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::config Boost::move Boost::smart_ptr)
|
||||
|
||||
boost_test(TYPE run SOURCES fclose_deleter_test.cpp)
|
||||
|
||||
@@ -6,11 +6,15 @@
|
||||
# See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
require-b2 5.0.1 ;
|
||||
import-search /boost/config/checks ;
|
||||
import config : requires ;
|
||||
import modules ;
|
||||
import testing ;
|
||||
|
||||
project : requirements
|
||||
|
||||
<library>/boost/core//boost_core
|
||||
<library>/boost/type_traits//boost_type_traits
|
||||
<warnings>extra
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
<toolset>clang:<warnings-as-errors>on
|
||||
@@ -31,6 +35,8 @@ local pedantic-errors = <warnings>pedantic
|
||||
<toolset>gcc:<warnings-as-errors>on
|
||||
<toolset>clang:<warnings-as-errors>on ;
|
||||
|
||||
local CPP11 = [ requires cxx11_variadic_templates cxx11_template_aliases cxx11_decltype cxx11_constexpr cxx11_noexcept cxx11_ref_qualifiers ] ;
|
||||
|
||||
# quick test (for CI)
|
||||
run quick.cpp ;
|
||||
|
||||
@@ -79,14 +85,14 @@ compile-fail ref_implicit_fail4.cpp
|
||||
run ref_cv_test.cpp ;
|
||||
run ref_conversion_test.cpp ;
|
||||
|
||||
run eif_constructors.cpp : ;
|
||||
run eif_dummy_arg_disambiguation.cpp : ;
|
||||
run eif_lazy.cpp : ;
|
||||
run eif_lazy_test.cpp : ;
|
||||
run eif_member_templates.cpp : ;
|
||||
run eif_namespace_disambiguation.cpp : ;
|
||||
run eif_no_disambiguation.cpp : ;
|
||||
run eif_partial_specializations.cpp : ;
|
||||
run eif_constructors.cpp ;
|
||||
run eif_dummy_arg_disambiguation.cpp ;
|
||||
run eif_lazy.cpp ;
|
||||
run eif_lazy_test.cpp ;
|
||||
run eif_member_templates.cpp ;
|
||||
run eif_namespace_disambiguation.cpp ;
|
||||
run eif_no_disambiguation.cpp ;
|
||||
run eif_partial_specializations.cpp ;
|
||||
|
||||
compile-fail noncopyable_compile_fail.cpp
|
||||
: $(warnings-as-errors-off) ;
|
||||
@@ -197,7 +203,13 @@ run underlying_type.cpp ;
|
||||
compile-fail null_deleter_compile_fail_adl.cpp
|
||||
: $(warnings-as-errors-off) ;
|
||||
|
||||
run fclose_deleter_test.cpp : : : <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS <target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE ;
|
||||
run fclose_deleter_test.cpp : : :
|
||||
$(CPP11)
|
||||
<library>/boost/move//boost_move
|
||||
<library>/boost/smart_ptr//boost_smart_ptr
|
||||
<target-os>windows:<define>_CRT_SECURE_NO_WARNINGS
|
||||
<target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE ;
|
||||
|
||||
compile-fail fclose_deleter_compile_fail_adl.cpp
|
||||
: <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS <target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE $(warnings-as-errors-off) ;
|
||||
|
||||
@@ -205,7 +217,6 @@ run functor_test.cpp ;
|
||||
compile-fail functor_compile_fail_adl.cpp
|
||||
: $(warnings-as-errors-off) ;
|
||||
|
||||
|
||||
run pointer_traits_pointer_test.cpp ;
|
||||
run pointer_traits_element_type_test.cpp ;
|
||||
run pointer_traits_difference_type_test.cpp ;
|
||||
@@ -226,6 +237,8 @@ run empty_value_test.cpp ;
|
||||
run empty_value_size_test.cpp ;
|
||||
run empty_value_final_test.cpp ;
|
||||
run empty_value_constexpr_test.cpp ;
|
||||
compile empty_value_nested_test.cpp ;
|
||||
compile-fail empty_value_compile_fail_casting.cpp ;
|
||||
|
||||
run quick_exit_test.cpp ;
|
||||
run-fail quick_exit_fail.cpp ;
|
||||
@@ -379,7 +392,7 @@ run sv_stream_insert_test.cpp
|
||||
: : : $(pedantic-errors) ;
|
||||
run sv_conversion_test.cpp
|
||||
: : : $(pedantic-errors) ;
|
||||
run sv_conversion_test2.cpp : ;
|
||||
run sv_conversion_test2.cpp : : : <library>/boost/utility//boost_utility ;
|
||||
run sv_common_reference_test.cpp
|
||||
: : : $(pedantic-errors) ;
|
||||
compile sv_common_reference_test2.cpp ;
|
||||
@@ -390,6 +403,8 @@ compile-fail sv_nullptr_fail.cpp
|
||||
compile sv_construct_test_cx.cpp ;
|
||||
compile sv_construct_test_cx2.cpp ;
|
||||
|
||||
run sv_hash_test.cpp : : : $(CPP11) <library>/boost/container_hash//boost_container_hash ;
|
||||
|
||||
run span_test.cpp ;
|
||||
run span_types_test.cpp ;
|
||||
run span_constructible_test.cpp ;
|
||||
@@ -417,11 +432,15 @@ run memory_resource_test.cpp ;
|
||||
run data_test.cpp ;
|
||||
run size_test.cpp ;
|
||||
|
||||
import ../../config/checks/config : requires ;
|
||||
|
||||
local CPP11 = [ requires cxx11_variadic_templates cxx11_template_aliases cxx11_decltype cxx11_constexpr cxx11_noexcept ] ;
|
||||
|
||||
local with-serialization = <library>/boost//serialization/<warnings>off $(warnings-as-errors-off) <undefined-sanitizer>norecover:<link>static $(CPP11) ;
|
||||
local with-serialization =
|
||||
<library>/boost/serialization//boost_serialization/<warnings>off
|
||||
$(warnings-as-errors-off)
|
||||
<undefined-sanitizer>norecover:<link>static
|
||||
$(CPP11)
|
||||
# Serialization no longer builds under classic MinGW
|
||||
# and <toolset>gcc,<target-os>windows,<address-model>32 fails for some reason
|
||||
<toolset>gcc,<target-os>windows:<build>no
|
||||
;
|
||||
|
||||
run serialization_nvp_test.cpp : : : $(with-serialization) <undefined-sanitizer>norecover:<build>no ;
|
||||
run serialization_split_free_test.cpp : : : $(with-serialization) ;
|
||||
|
||||
@@ -14,4 +14,4 @@ target_link_libraries(quick Boost::core)
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
||||
@@ -18,4 +18,4 @@ target_link_libraries(quick Boost::core)
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
||||
20
test/empty_value_compile_fail_casting.cpp
Normal file
20
test/empty_value_compile_fail_casting.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2024 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/core/empty_value.hpp>
|
||||
|
||||
struct empty {};
|
||||
|
||||
// This test ensures private inheritance of `boost::empty_value<T>` for empty `T`.
|
||||
// With public inheritance, `boost::empty_value<empty>*` could cast to `empty*`.
|
||||
void test_empty_not_convertible_to_base()
|
||||
{
|
||||
const boost::empty_value<empty> x(boost::empty_init);
|
||||
const empty* x2 = static_cast<const empty*>(&x);
|
||||
(void)x2;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
45
test/empty_value_nested_test.cpp
Normal file
45
test/empty_value_nested_test.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
Copyright 2024 Braden Ganetsky
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/core/empty_value.hpp>
|
||||
|
||||
/*
|
||||
Tests workaround for MSVC bug:
|
||||
https://developercommunity.visualstudio.com/t/Compiler-bug:-Incorrect-C2247-and-C2248/10690025
|
||||
*/
|
||||
template<class T>
|
||||
struct derived
|
||||
: boost::empty_value<T> {
|
||||
typedef typename boost::empty_value<T>::type type;
|
||||
derived(boost::empty_init_t e)
|
||||
: boost::empty_value<T>(e) { }
|
||||
};
|
||||
|
||||
struct outer {
|
||||
struct inner_empty { };
|
||||
struct inner_non_empty {
|
||||
inner_non_empty()
|
||||
: value() { }
|
||||
int value;
|
||||
};
|
||||
};
|
||||
|
||||
void test()
|
||||
{
|
||||
const boost::empty_value<outer> x1(boost::empty_init);
|
||||
(void)x1;
|
||||
const boost::empty_value<outer::inner_empty> x2(boost::empty_init);
|
||||
(void)x2;
|
||||
const boost::empty_value<outer::inner_non_empty> x3(boost::empty_init);
|
||||
(void)x3;
|
||||
const derived<outer> x4(boost::empty_init);
|
||||
(void)x4;
|
||||
const derived<outer::inner_empty> x5(boost::empty_init);
|
||||
(void)x5;
|
||||
const derived<outer::inner_non_empty> x6(boost::empty_init);
|
||||
(void)x6;
|
||||
}
|
||||
48
test/sv_hash_test.cpp
Normal file
48
test/sv_hash_test.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright 2021-2024 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/core/detail/string_view.hpp>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <string>
|
||||
|
||||
template<class T> std::size_t hv( T const& t )
|
||||
{
|
||||
return boost::hash<T>()( t );
|
||||
}
|
||||
|
||||
template<class Ch> void test( Ch const* p )
|
||||
{
|
||||
std::basic_string<Ch> s( p );
|
||||
boost::core::basic_string_view<Ch> sv( s );
|
||||
|
||||
BOOST_TEST_EQ( hv( s ), hv( sv ) );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test( "123" );
|
||||
test( L"123" );
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_CHAR16_T)
|
||||
|
||||
test( u"123" );
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_CHAR32_T)
|
||||
|
||||
test( U"123" );
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
|
||||
|
||||
test( u8"123" );
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user