mirror of
https://github.com/boostorg/core.git
synced 2026-05-07 00:46:44 +02:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb34afaabd | |||
| e8fdc407bd | |||
| 64093058de | |||
| 3cd29323be | |||
| 45bd9bf69b | |||
| 6814bc508c | |||
| 40fda50ae1 | |||
| 8a352e253a | |||
| c6b098d25d | |||
| c4bfbf9ec5 | |||
| a128501403 | |||
| 24b5bb625e | |||
| d513ed162a |
+25
-12
@@ -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 []) +
|
||||
@@ -235,6 +234,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 25.04 GCC 15 32/64",
|
||||
"cppalliance/droneubuntu2504:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '03,11,14,17,20,23,2c', ADDRMD: '32,64' },
|
||||
"g++-15-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.5",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
@@ -369,26 +375,33 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 UBSAN",
|
||||
"Linux 24.04 Clang 18",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 ASAN",
|
||||
"Linux 24.04 Clang 19 UBSAN",
|
||||
"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' },
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
"clang-19",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 19 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
"clang-19",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 25.04 Clang 20",
|
||||
"cppalliance/droneubuntu2504:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '03,11,14,17,20,23,2c' },
|
||||
"clang-20",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 10.15 Xcode 12.2 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan,
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ target_link_libraries(boost_core
|
||||
Boost::throw_exception
|
||||
)
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.19 AND CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
|
||||
file(GLOB_RECURSE boost_core_IDEFILES CONFIGURE_DEPENDS include/*.hpp)
|
||||
source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_core_IDEFILES} PREFIX "Header Files")
|
||||
|
||||
@@ -12,8 +12,8 @@ The criteria for inclusion is that the utility component be:
|
||||
|
||||
Branch | GitHub Actions | AppVeyor | Test Matrix | Dependencies |
|
||||
---------|----------------|--------- | ----------- | ------------ |
|
||||
Develop | [](https://github.com/boostorg/filesystem/actions?query=branch%3Adevelop) | [](https://ci.appveyor.com/project/pdimov/core) | [](http://www.boost.org/development/tests/develop/developer/core.html) | [](https://pdimov.github.io/boostdep-report/develop/core.html)
|
||||
Master | [](https://github.com/boostorg/filesystem/actions?query=branch%3Amaster) | [](https://ci.appveyor.com/project/pdimov/core) | [](http://www.boost.org/development/tests/master/developer/core.html) | [](https://pdimov.github.io/boostdep-report/master/core.html)
|
||||
Develop | [](https://github.com/boostorg/filesystem/actions?query=branch%3Adevelop) | [](https://ci.appveyor.com/project/pdimov/core) | [](https://regression.boost.io/develop/developer/core.html) | [](https://pdimov.github.io/boostdep-report/develop/core.html)
|
||||
Master | [](https://github.com/boostorg/filesystem/actions?query=branch%3Amaster) | [](https://ci.appveyor.com/project/pdimov/core) | [](https://regression.boost.io/master/developer/core.html) | [](https://pdimov.github.io/boostdep-report/master/core.html)
|
||||
|
||||
### Directories
|
||||
|
||||
|
||||
+21
-1
@@ -1,12 +1,32 @@
|
||||
[/
|
||||
Copyright 2021 Peter Dimov
|
||||
Copyright 2022-2024 Andrey Semashev
|
||||
Copyright 2022-2025 Andrey Semashev
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
https://boost.org/LICENSE_1_0.txt)
|
||||
]
|
||||
|
||||
[section Revision History]
|
||||
|
||||
[section Changes in 1.90.0]
|
||||
|
||||
* The implementation of `BOOST_TEST_THROWS` and `BOOST_TEST_NO_THROW` macros defined in
|
||||
[link core.lightweight_test `boost/core/lightweight_test.hpp`] has been changed to avoid
|
||||
compiler warnings on some compilers, when the macros are used in `if`/`else` blocks. As
|
||||
a side effect of this change, the semicolon after the macro is now necessary. ([github_pr 205])
|
||||
* [link core.data `boost::data`] and [link core.size `boost::size`] are now aliases for `std::data`
|
||||
and `std::size`, respectively, when the latter are provided by compiler. This resolves potential
|
||||
ambiguities when both `boost::` and `std::` alternatives are found by the compiler, e.g. as a result
|
||||
of ADL. ([github_issue 206])
|
||||
|
||||
[endsect]
|
||||
|
||||
[section Changes in 1.89.0]
|
||||
|
||||
* Fixed `bit_ceil` to return 1 for input 0 as per specification. ([github_pr 199])
|
||||
* Added support for `std::format` to `boost::core::string_view`. ([github_issue 190])
|
||||
|
||||
[endsect]
|
||||
|
||||
[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`
|
||||
|
||||
@@ -8,8 +8,20 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#ifndef BOOST_CORE_DATA_HPP
|
||||
#define BOOST_CORE_DATA_HPP
|
||||
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
|
||||
// Note: MSVC doesn't define __cpp_lib_nonmember_container_access but supports the feature even in C++14 mode
|
||||
#if (defined(__cpp_lib_nonmember_container_access) && (__cpp_lib_nonmember_container_access >= 201411l)) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|
||||
|
||||
namespace boost {
|
||||
using std::data;
|
||||
} /* boost */
|
||||
|
||||
#else // (defined(__cpp_lib_nonmember_container_access) ...
|
||||
|
||||
#include <cstddef>
|
||||
#include <initializer_list>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -43,4 +55,6 @@ data(std::initializer_list<T> l) noexcept
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif // (defined(__cpp_lib_nonmember_container_access) ...
|
||||
|
||||
#endif
|
||||
|
||||
@@ -551,39 +551,56 @@ inline void lwt_init()
|
||||
#define BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2) ( ::boost::detail::test_all_eq_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2) )
|
||||
#define BOOST_TEST_ALL_WITH(begin1, end1, begin2, end2, predicate) ( ::boost::detail::test_all_with_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2, predicate) )
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#define BOOST_TEST_THROWS( EXPR, EXCEP ) \
|
||||
try { \
|
||||
EXPR; \
|
||||
::boost::detail::throw_failed_impl \
|
||||
(#EXPR, #EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
catch(EXCEP const&) { \
|
||||
::boost::detail::test_results(); \
|
||||
} \
|
||||
catch(...) { \
|
||||
::boost::detail::throw_failed_impl \
|
||||
(#EXPR, #EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
//
|
||||
#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1900)
|
||||
// The usual idiom for multiline macros. But disabled for MSVC versions
|
||||
// prior to 2015, which would emit a "conditional expression is constant"
|
||||
// warning that we could not silence with a _Pragma, despite this being
|
||||
// the same thing described here:
|
||||
//
|
||||
// <https://learn.microsoft.com/en-us/cpp/preprocessor/pragma-directives-and-the-pragma-keyword?view=msvc-140>.
|
||||
//
|
||||
#define BOOST_LWT_DETAIL_DO_WHILE_FALSE( x ) do { x } while (false)
|
||||
#else
|
||||
#define BOOST_TEST_THROWS( EXPR, EXCEP )
|
||||
#define BOOST_LWT_DETAIL_DO_WHILE_FALSE( x ) x
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
# define BOOST_TEST_NO_THROW(EXPR) \
|
||||
try { \
|
||||
EXPR; \
|
||||
} catch (const std::exception& e) { \
|
||||
::boost::detail::no_throw_failed_impl \
|
||||
(#EXPR, e.what(), __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} catch (...) { \
|
||||
::boost::detail::no_throw_failed_impl \
|
||||
(#EXPR, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
}
|
||||
#define BOOST_TEST_THROWS( EXPR, EXCEP ) \
|
||||
BOOST_LWT_DETAIL_DO_WHILE_FALSE( \
|
||||
try { \
|
||||
EXPR; \
|
||||
::boost::detail::throw_failed_impl \
|
||||
(#EXPR, #EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
catch(EXCEP const&) { \
|
||||
::boost::detail::test_results(); \
|
||||
} \
|
||||
catch(...) { \
|
||||
::boost::detail::throw_failed_impl \
|
||||
(#EXPR, #EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
)
|
||||
//
|
||||
#else
|
||||
#define BOOST_TEST_THROWS( EXPR, EXCEP ) BOOST_LWT_DETAIL_DO_WHILE_FALSE((void)0;)
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
# define BOOST_TEST_NO_THROW(EXPR) \
|
||||
BOOST_LWT_DETAIL_DO_WHILE_FALSE( \
|
||||
try { \
|
||||
EXPR; \
|
||||
} catch (const std::exception& e) { \
|
||||
::boost::detail::no_throw_failed_impl \
|
||||
(#EXPR, e.what(), __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} catch (...) { \
|
||||
::boost::detail::no_throw_failed_impl \
|
||||
(#EXPR, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
)
|
||||
//
|
||||
#else
|
||||
# define BOOST_TEST_NO_THROW(EXPR) { EXPR; }
|
||||
# define BOOST_TEST_NO_THROW(EXPR) BOOST_LWT_DETAIL_DO_WHILE_FALSE(EXPR;)
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_HPP
|
||||
|
||||
@@ -8,6 +8,18 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#ifndef BOOST_CORE_SIZE_HPP
|
||||
#define BOOST_CORE_SIZE_HPP
|
||||
|
||||
#include <iterator>
|
||||
|
||||
// Note: MSVC doesn't define __cpp_lib_nonmember_container_access but supports the feature even in C++14 mode
|
||||
#if (defined(__cpp_lib_nonmember_container_access) && (__cpp_lib_nonmember_container_access >= 201411l)) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|
||||
|
||||
namespace boost {
|
||||
using std::size;
|
||||
} /* boost */
|
||||
|
||||
#else // (defined(__cpp_lib_nonmember_container_access) ...
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
@@ -28,4 +40,6 @@ size(T(&)[N]) noexcept
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif // (defined(__cpp_lib_nonmember_container_access) ...
|
||||
|
||||
#endif
|
||||
|
||||
@@ -416,6 +416,7 @@ run span_constexpr_test.cpp ;
|
||||
run as_bytes_test.cpp ;
|
||||
run as_writable_bytes_test.cpp ;
|
||||
compile span_boost_begin_test.cpp ;
|
||||
compile span_nonmem_data_size_test.cpp ;
|
||||
run make_span_test.cpp ;
|
||||
|
||||
run splitmix64_test.cpp
|
||||
|
||||
@@ -9,6 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#if !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
#include <boost/core/data.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iterator>
|
||||
|
||||
class range {
|
||||
public:
|
||||
@@ -52,12 +53,28 @@ void test_initializer_list()
|
||||
BOOST_TEST_EQ(boost::data(l), l.begin());
|
||||
}
|
||||
|
||||
void test_ambiguity_with_std_data()
|
||||
{
|
||||
// Note: This preprocessor check should be equivalent to that in boost/core/data.hpp
|
||||
#if (defined(__cpp_lib_nonmember_container_access) && (__cpp_lib_nonmember_container_access >= 201411l)) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|
||||
|
||||
// https://github.com/boostorg/core/issues/206
|
||||
range c;
|
||||
using std::data;
|
||||
using boost::data;
|
||||
BOOST_TEST_EQ(data(c), c.data());
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_range();
|
||||
test_const_range();
|
||||
test_array();
|
||||
test_initializer_list();
|
||||
test_ambiguity_with_std_data();
|
||||
return boost::report_errors();
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -9,6 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#if !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
#include <boost/core/size.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iterator>
|
||||
|
||||
struct range {
|
||||
std::size_t size() const {
|
||||
@@ -28,10 +29,26 @@ void test_array()
|
||||
BOOST_TEST_EQ(boost::size(a), 4);
|
||||
}
|
||||
|
||||
void test_ambiguity_with_std_size()
|
||||
{
|
||||
// Note: This preprocessor check should be equivalent to that in boost/core/size.hpp
|
||||
#if (defined(__cpp_lib_nonmember_container_access) && (__cpp_lib_nonmember_container_access >= 201411l)) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|
||||
|
||||
// https://github.com/boostorg/core/issues/206
|
||||
range c;
|
||||
using std::size;
|
||||
using boost::size;
|
||||
BOOST_TEST_EQ(size(c), c.size());
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_range();
|
||||
test_array();
|
||||
test_ambiguity_with_std_size();
|
||||
return boost::report_errors();
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2025.
|
||||
* 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)
|
||||
*/
|
||||
/*
|
||||
* The test verifies that unqualified calls to data() and size()
|
||||
* don't cause ambiguity between std:: and boost:: implementations.
|
||||
* The ambiguity used to be caused by ADL bringing boost::data()/size()
|
||||
* due to namespace of boost::span and a using-declaration of
|
||||
* std::data()/size().
|
||||
*
|
||||
* https://github.com/boostorg/core/issues/206
|
||||
*/
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
|
||||
#include <boost/core/span.hpp>
|
||||
#include <iterator>
|
||||
|
||||
// Note: This preprocessor check should be equivalent to those in boost/core/data.hpp and boost/core/size.hpp
|
||||
#if (defined(__cpp_lib_nonmember_container_access) && (__cpp_lib_nonmember_container_access >= 201411l)) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|
||||
|
||||
#include <boost/core/data.hpp>
|
||||
#include <boost/core/size.hpp>
|
||||
|
||||
int* test_data_ambiguity(boost::span<int> sp)
|
||||
{
|
||||
using std::data;
|
||||
return data(sp);
|
||||
}
|
||||
|
||||
boost::span<int>::size_type test_size_ambiguity(boost::span<int> sp)
|
||||
{
|
||||
using std::size;
|
||||
return size(sp);
|
||||
}
|
||||
|
||||
#endif // (defined(__cpp_lib_nonmember_container_access) ...
|
||||
#endif // !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
Reference in New Issue
Block a user