1
0
forked from boostorg/core

Compare commits

..

3 Commits

Author SHA1 Message Date
Peter Dimov
29571b3750 Remove <address-model>32 from Serialization requirement 2024-11-10 21:47:27 +02:00
Peter Dimov
b9e8d2d986 Remove non-GCC Appveyor jobs 2024-11-10 21:46:08 +02:00
Peter Dimov
24f4fbc876 Disable serialization tests under MinGW 32 bit 2024-11-10 20:44:39 +02:00
9 changed files with 29 additions and 157 deletions

View File

@@ -124,7 +124,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
linux_pipeline(
"Linux 16.04 GCC 4.8 32/64",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-4.8', CXXSTD: '03,11', ADDRMD: '32,64' },
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11', ADDRMD: '32,64' },
"g++-4.8-multilib",
),

View File

@@ -125,7 +125,7 @@ jobs:
cxxstd: "03,11,14,17,20,23"
address-model: 32,64
os: ubuntu-latest
container: ubuntu:24.04
container: ubuntu:23.04
install:
- g++-13-multilib
- toolset: gcc-14
@@ -283,7 +283,7 @@ jobs:
compiler: clang++-16
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:24.04
container: ubuntu:23.04
install:
- clang-16
- libc++-16-dev
@@ -294,7 +294,7 @@ jobs:
compiler: clang++-17
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:24.04
container: ubuntu:23.10
install:
- clang-17
- libc++-17-dev
@@ -312,17 +312,6 @@ jobs:
- libc++abi-18-dev
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
- toolset: clang
compiler: clang++-19
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:24.10
install:
- clang-19
- libc++-19-dev
- libc++abi-19-dev
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
- name: UBSAN
toolset: clang
compiler: clang++-15

View File

@@ -14,31 +14,6 @@ branches:
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
ADDRMD: 32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-12.0,msvc-14.0
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
ADDRMD: 32,64
CXXSTD: 14,17
# clang-win 32 bit fails to link with "unable to load mspdbcore.dll (error code: 126)"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: clang-win
ADDRMD: 64
CXXSTD: 14,17,latest
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
TOOLSET: clang-win
ADDRMD: 64
CXXSTD: 14,17,latest
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\cygwin\bin;
TOOLSET: gcc
@@ -64,13 +39,6 @@ environment:
TOOLSET: gcc
CXXSTD: 03,11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE: 1
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_SUBDIR: 1
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_INSTALL: 1
install:
- set GIT_FETCH_JOBS=8
- set BOOST_BRANCH=develop

View File

@@ -67,7 +67,7 @@ namespace core
inline void sp_thread_sleep() BOOST_NOEXCEPT
{
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__) && !defined(__OHOS__)
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
int oldst;
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldst );
@@ -85,7 +85,7 @@ inline void sp_thread_sleep() BOOST_NOEXCEPT
nanosleep( &rqtp, 0 );
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__) && !defined(__OHOS__)
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
pthread_setcancelstate( oldst, &oldst );

View File

@@ -41,6 +41,9 @@ 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
@@ -378,7 +381,7 @@ public:
}
template<class End> BOOST_CXX14_CONSTEXPR basic_string_view( Ch const* first, End last,
typename boost::enable_if<boost::core::detail::is_same<End, Ch const*>, int >::type = 0 ) BOOST_NOEXCEPT: p_( first ), n_( static_cast<size_type>( last - first ) )
typename boost::enable_if<boost::core::detail::is_same<End, Ch const*> >::type* = 0 ) BOOST_NOEXCEPT: p_( first ), n_( static_cast<size_type>( last - first ) )
{
BOOST_ASSERT( last - first >= 0 );
}
@@ -396,7 +399,7 @@ public:
#endif
template<class Ch2> basic_string_view( boost::basic_string_view<Ch2, std::char_traits<Ch2> > const& str,
typename boost::enable_if<boost::core::detail::is_same<Ch, Ch2>, int >::type = 0 ) BOOST_NOEXCEPT: p_( str.data() ), n_( str.size() )
typename boost::enable_if<boost::core::detail::is_same<Ch, Ch2> >::type* = 0 ) BOOST_NOEXCEPT: p_( str.data() ), n_( str.size() )
{
}
@@ -1178,6 +1181,11 @@ public:
}
#endif
inline friend std::size_t hash_value( basic_string_view const& sv )
{
return boost::hash_range( sv.begin(), sv.end() );
}
};
// stream inserter

View File

@@ -9,19 +9,10 @@ Distributed under the Boost Software License, Version 1.0.
#define BOOST_CORE_SPAN_HPP
#include <boost/core/data.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <array>
#include <iterator>
#include <type_traits>
#if BOOST_WORKAROUND(BOOST_GCC, < 50000)
# define BOOST_CORE_SPAN_CONSTEXPR
#else
# define BOOST_CORE_SPAN_CONSTEXPR constexpr
#endif
namespace boost {
constexpr std::size_t dynamic_extent = static_cast<std::size_t>(-1);
@@ -282,22 +273,18 @@ public:
return span<T, C>(s_.p + O, C);
}
BOOST_CORE_SPAN_CONSTEXPR span<T, dynamic_extent> first(size_type c) const {
return BOOST_ASSERT(c <= size()),
span<T, dynamic_extent>(s_.p, c);
constexpr span<T, dynamic_extent> first(size_type c) const {
return span<T, dynamic_extent>(s_.p, c);
}
BOOST_CORE_SPAN_CONSTEXPR span<T, dynamic_extent> last(size_type c) const {
return BOOST_ASSERT(c <= size()),
span<T, dynamic_extent>(s_.p + (s_.n - c), c);
constexpr span<T, dynamic_extent> last(size_type c) const {
return span<T, dynamic_extent>(s_.p + (s_.n - c), c);
}
BOOST_CORE_SPAN_CONSTEXPR span<T, dynamic_extent> subspan(size_type o,
constexpr span<T, dynamic_extent> subspan(size_type o,
size_type c = dynamic_extent) const {
return BOOST_ASSERT(o <= size() &&
(c == dynamic_extent || c + o <= size())),
span<T, dynamic_extent>(s_.p + o,
c == dynamic_extent ? s_.n - o : c);
return span<T, dynamic_extent>(s_.p + o,
c == dynamic_extent ? s_.n - o : c);
}
constexpr size_type size() const noexcept {
@@ -312,16 +299,16 @@ public:
return s_.n == 0;
}
BOOST_CORE_SPAN_CONSTEXPR reference operator[](size_type i) const {
return BOOST_ASSERT(i < size()), s_.p[i];
constexpr reference operator[](size_type i) const {
return s_.p[i];
}
BOOST_CORE_SPAN_CONSTEXPR reference front() const {
return BOOST_ASSERT(!empty()), *s_.p;
constexpr reference front() const {
return *s_.p;
}
BOOST_CORE_SPAN_CONSTEXPR reference back() const {
return BOOST_ASSERT(!empty()), s_.p[s_.n - 1];
constexpr reference back() const {
return s_.p[s_.n - 1];
}
constexpr pointer data() const noexcept {
@@ -411,6 +398,4 @@ as_writable_bytes(span<T, E> s) noexcept
} /* boost */
#undef BOOST_CORE_SPAN_CONSTEXPR
#endif

View File

@@ -16,10 +16,6 @@ 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)

View File

@@ -409,7 +409,6 @@ run span_test.cpp ;
run span_types_test.cpp ;
run span_constructible_test.cpp ;
run span_deduction_guide_test.cpp ;
run span_constexpr_test.cpp ;
run as_bytes_test.cpp ;
run as_writable_bytes_test.cpp ;
compile span_boost_begin_test.cpp ;

View File

@@ -1,73 +0,0 @@
/*
Copyright 2025 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if !defined(BOOST_NO_CXX11_CONSTEXPR) && !BOOST_WORKAROUND(BOOST_GCC, < 50000)
#include <boost/core/span.hpp>
#include <boost/core/lightweight_test.hpp>
constexpr const int array[4]{ 5, 10, 15, 20 };
void test_first()
{
constexpr boost::span<const int> s =
boost::span<const int>(array, 4).first(2);
BOOST_TEST_EQ(s.data(), &array[0]);
BOOST_TEST_EQ(s.size(), 2);
}
void test_last()
{
constexpr boost::span<const int> s =
boost::span<const int>(array, 4).last(2);
BOOST_TEST_EQ(s.data(), &array[2]);
BOOST_TEST_EQ(s.size(), 2);
}
void test_subspan()
{
constexpr boost::span<const int> s =
boost::span<const int>(array, 4).subspan(1, 2);
BOOST_TEST_EQ(s.data(), &array[1]);
BOOST_TEST_EQ(s.size(), 2);
}
void test_index()
{
constexpr const int i = boost::span<const int>(array, 4)[1];
BOOST_TEST_EQ(i, 10);
}
void test_front()
{
constexpr const int i = boost::span<const int>(array, 4).front();
BOOST_TEST_EQ(i, 5);
}
void test_back()
{
constexpr const int i = boost::span<const int>(array, 4).back();
BOOST_TEST_EQ(i, 20);
}
int main()
{
test_first();
test_last();
test_subspan();
test_index();
test_front();
test_back();
return boost::report_errors();
}
#else
int main()
{
return 0;
}
#endif