forked from boostorg/core
Compare commits
3 Commits
feature/bi
...
feature/sp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d92a7b0498 | ||
|
|
5f6bb283fb | ||
|
|
6b1d7a91e6 |
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@@ -100,13 +100,13 @@ jobs:
|
||||
- toolset: gcc-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
address-model: 32,64
|
||||
os: ubuntu-24.04
|
||||
os: ubuntu-20.04
|
||||
install:
|
||||
- g++-9-multilib
|
||||
- toolset: gcc-10
|
||||
cxxstd: "03,11,14,17,20"
|
||||
address-model: 32,64
|
||||
os: ubuntu-24.04
|
||||
os: ubuntu-20.04
|
||||
install:
|
||||
- g++-10-multilib
|
||||
- toolset: gcc-11
|
||||
@@ -220,15 +220,13 @@ jobs:
|
||||
- toolset: clang
|
||||
compiler: clang++-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-20.04
|
||||
install:
|
||||
- clang-9
|
||||
- toolset: clang
|
||||
compiler: clang++-10
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-20.04
|
||||
install:
|
||||
- clang-10
|
||||
- toolset: clang
|
||||
@@ -637,6 +635,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
@@ -704,6 +703,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
@@ -781,6 +781,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
|
||||
@@ -38,7 +38,7 @@ and return type use spans.
|
||||
|
||||
```
|
||||
auto sha1(boost::span<const unsigned char> input,
|
||||
boost::span<unsigned char, SHA_DIGEST_LENGTH> output)
|
||||
boost::span<unsigned char, SHA_DIGEST_LENGTH> ouput)
|
||||
{
|
||||
SHA_CTX context;
|
||||
SHA1_Init(&context);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# pragma intrinsic(_BitScanForward)
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
|
||||
# if defined(_M_X64) || defined(_M_ARM64)
|
||||
# if defined(_M_X64)
|
||||
# pragma intrinsic(_BitScanForward64)
|
||||
# pragma intrinsic(_BitScanReverse64)
|
||||
# endif
|
||||
@@ -230,7 +230,7 @@ inline int countl_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL)
|
||||
#if defined(_MSC_VER) && defined(_M_X64) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL)
|
||||
|
||||
BOOST_CXX14_CONSTEXPR inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -255,7 +255,7 @@ BOOST_CXX14_CONSTEXPR inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
|
||||
#elif defined(_MSC_VER) && defined(_M_X64)
|
||||
|
||||
inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -455,7 +455,7 @@ inline int countr_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL)
|
||||
#if defined(_MSC_VER) && defined(_M_X64) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL)
|
||||
|
||||
BOOST_CXX14_CONSTEXPR inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -480,7 +480,7 @@ BOOST_CXX14_CONSTEXPR inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
|
||||
#elif defined(_MSC_VER) && defined(_M_X64)
|
||||
|
||||
inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -703,7 +703,7 @@ BOOST_CXX14_CONSTEXPR inline boost::uint32_t bit_ceil_impl( boost::uint32_t x )
|
||||
{
|
||||
if( x == 0 )
|
||||
{
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
--x;
|
||||
@@ -723,7 +723,7 @@ BOOST_CXX14_CONSTEXPR inline boost::uint64_t bit_ceil_impl( boost::uint64_t x )
|
||||
{
|
||||
if( x == 0 )
|
||||
{
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
--x;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#if defined( BOOST_CORE_HAS_CXXABI_H )
|
||||
# include <cxxabi.h>
|
||||
// For some architectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
|
||||
// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
|
||||
// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement
|
||||
// abi::__cxa_demangle(). We detect this implementation by checking the include guard here.
|
||||
# if defined( __GABIXX_CXXABI_H__ )
|
||||
|
||||
@@ -1,18 +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)
|
||||
*/
|
||||
#undef BOOST_CORE_DETAIL_ASSERT
|
||||
|
||||
#if !defined(__clang__) && \
|
||||
!defined(__INTEL_COMPILER) && \
|
||||
defined(__GNUC__) && \
|
||||
(__GNUC__ < 5)
|
||||
#define BOOST_CORE_DETAIL_ASSERT(expr) void(0)
|
||||
#else
|
||||
#include <boost/assert.hpp>
|
||||
#define BOOST_CORE_DETAIL_ASSERT(expr) BOOST_ASSERT(expr)
|
||||
#endif
|
||||
@@ -37,7 +37,7 @@ namespace boost
|
||||
/**
|
||||
* Casts a scoped enum to its underlying type.
|
||||
*
|
||||
* This function is useful when working with scoped enum classes, which doesn't implicitly convert to the underlying type.
|
||||
* This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
|
||||
* @param v A scoped enum.
|
||||
* @returns The underlying type.
|
||||
* @throws No-throws.
|
||||
|
||||
@@ -8,12 +8,20 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#ifndef BOOST_CORE_SPAN_HPP
|
||||
#define BOOST_CORE_SPAN_HPP
|
||||
|
||||
#include <boost/core/detail/assert.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);
|
||||
@@ -274,19 +282,19 @@ public:
|
||||
return span<T, C>(s_.p + O, C);
|
||||
}
|
||||
|
||||
constexpr span<T, dynamic_extent> first(size_type c) const {
|
||||
return BOOST_CORE_DETAIL_ASSERT(c <= size()),
|
||||
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> last(size_type c) const {
|
||||
return BOOST_CORE_DETAIL_ASSERT(c <= size()),
|
||||
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> subspan(size_type o,
|
||||
BOOST_CORE_SPAN_CONSTEXPR span<T, dynamic_extent> subspan(size_type o,
|
||||
size_type c = dynamic_extent) const {
|
||||
return BOOST_CORE_DETAIL_ASSERT(o <= size() &&
|
||||
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);
|
||||
@@ -304,16 +312,16 @@ public:
|
||||
return s_.n == 0;
|
||||
}
|
||||
|
||||
constexpr reference operator[](size_type i) const {
|
||||
return BOOST_CORE_DETAIL_ASSERT(i < size()), s_.p[i];
|
||||
BOOST_CORE_SPAN_CONSTEXPR reference operator[](size_type i) const {
|
||||
return BOOST_ASSERT(i < size()), s_.p[i];
|
||||
}
|
||||
|
||||
constexpr reference front() const {
|
||||
return BOOST_CORE_DETAIL_ASSERT(!empty()), *s_.p;
|
||||
BOOST_CORE_SPAN_CONSTEXPR reference front() const {
|
||||
return BOOST_ASSERT(!empty()), *s_.p;
|
||||
}
|
||||
|
||||
constexpr reference back() const {
|
||||
return BOOST_CORE_DETAIL_ASSERT(!empty()), s_.p[s_.n - 1];
|
||||
BOOST_CORE_SPAN_CONSTEXPR reference back() const {
|
||||
return BOOST_ASSERT(!empty()), s_.p[s_.n - 1];
|
||||
}
|
||||
|
||||
constexpr pointer data() const noexcept {
|
||||
@@ -403,4 +411,6 @@ as_writable_bytes(span<T, E> s) noexcept
|
||||
|
||||
} /* boost */
|
||||
|
||||
#undef BOOST_CORE_SPAN_CONSTEXPR
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,15 +19,14 @@ template<class T> void test_bit_ceil( T x )
|
||||
|
||||
T y = boost::core::bit_ceil( x );
|
||||
|
||||
BOOST_TEST( boost::core::has_single_bit( y ) );
|
||||
BOOST_TEST_GE( +y, +x );
|
||||
|
||||
if( x == 0 )
|
||||
{
|
||||
BOOST_TEST_EQ( y, 1 );
|
||||
BOOST_TEST_EQ( y, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_TEST( boost::core::has_single_bit( y ) );
|
||||
BOOST_TEST_GE( +y, +x );
|
||||
BOOST_TEST_LT( y >> 1, +x );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ using std::distance;
|
||||
|
||||
*/
|
||||
|
||||
// struct C {} doesn't work with libc++.
|
||||
// struct C {} doesn't wotk with libc++.
|
||||
typedef std::forward_iterator_tag C;
|
||||
|
||||
struct T
|
||||
|
||||
@@ -6,7 +6,8 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_CONSTEXPR)
|
||||
#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>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// objects to be swapped would themselves be from the boost namespace.
|
||||
// If so, boost::core::invoke_swap itself might be found by argument dependent lookup.
|
||||
// The implementation of boost::core::invoke_swap resolves this issue by giving
|
||||
// boost::core::invoke_swap two template arguments, thereby making it less specialized
|
||||
// boost::core::invoke_swap two template argumetns, thereby making it less specialized
|
||||
// than std::swap.
|
||||
|
||||
#include <boost/core/invoke_swap.hpp>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//Put test class in the global namespace
|
||||
#include "./swap_test_class.hpp"
|
||||
|
||||
//Provide swap function in global namespace
|
||||
//Provide swap function in gloabl namespace
|
||||
void swap(swap_test_class& left, swap_test_class& right)
|
||||
{
|
||||
left.swap(right);
|
||||
|
||||
Reference in New Issue
Block a user