Skip to content

Commit 67a6c32

Browse files
committed
Merge branch 'develop'
2 parents 9387d1e + 085c27f commit 67a6c32

File tree

7 files changed

+94
-177
lines changed

7 files changed

+94
-177
lines changed

.drone.star

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def main(ctx):
2222
linux_cxx("TOOLSET=gcc COMPILER=g++-10 CXXSTD=03,11,14,17,20", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '03,11,14,17,20'}, globalenv=globalenv),
2323
linux_cxx("TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a", "clang++-9", packages="clang-9", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '03,11,14,17,2a'}, globalenv=globalenv),
2424
linux_cxx("TOOLSET=clang COMPILER=clang++-10 CXXSTD=03,11,14,17,20", "clang++-10", packages="clang-10", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '03,11,14,17,20'}, globalenv=globalenv),
25-
linux_cxx("Ubuntu g++-13", packages="g++-13", buildtype="boost", image="cppalliance/droneubuntu2304:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-13', 'CXXSTD': '14,17,20,23', }, globalenv=globalenv),
25+
linux_cxx("Ubuntu g++-13", packages="g++-13", buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-13', 'CXXSTD': '14,17,20,23', }, globalenv=globalenv),
26+
linux_cxx("Ubuntu g++-14", packages="g++-14", buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-14', 'CXXSTD': '14,17,20,23', }, globalenv=globalenv),
2627
osx_cxx("XCode-11.7 03,11,17,2a", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,17,2a', }, globalenv=globalenv),
2728
osx_cxx("XCode-10.2 03,11,17,2a", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,17,2a', }, globalenv=globalenv),
2829
]

.drone/boost.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,12 @@ cd ..
1919
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
2020
cd boost-root
2121
git submodule update --init tools/build
22+
git submodule update --init libs/config
2223
git submodule update --init tools/boost_install
2324
git submodule update --init libs/headers
24-
git submodule update --init libs/config
25-
git submodule update --init libs/assert
26-
git submodule update --init libs/bind
27-
git submodule update --init libs/core
28-
git submodule update --init libs/detail
29-
git submodule update --init libs/function
30-
git submodule update --init libs/integer
31-
git submodule update --init libs/move
32-
git submodule update --init libs/mpl
33-
git submodule update --init libs/preprocessor
34-
git submodule update --init libs/static_assert
35-
git submodule update --init libs/throw_exception
36-
git submodule update --init libs/type_index
37-
git submodule update --init libs/utility
25+
git submodule update --init tools/boostdep
3826
cp -r $TRAVIS_BUILD_DIR/* libs/type_traits
27+
python tools/boostdep/depinst/depinst.py type_traits
3928
./bootstrap.sh
4029
./b2 headers
4130

.github/workflows/ci.yml

Lines changed: 5 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ on:
1414
release:
1515
types: [published, created, edited]
1616
jobs:
17-
ubuntu-jammy:
18-
runs-on: ubuntu-22.04
17+
ubuntu-24_04:
18+
runs-on: ubuntu-24.04
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
compiler: [ g++-11, g++-12, clang++-14 ]
22+
compiler: [ g++-12, g++-13, clang++-15, clang++-16, clang++-17, clang++-18 ]
2323
standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ]
2424
steps:
2525
- uses: actions/checkout@v2
@@ -47,7 +47,7 @@ jobs:
4747
if: steps.retry1.outcome=='failure'
4848
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
4949
- name: Install packages
50-
run: sudo apt install g++-11 g++-12 clang-14
50+
run: sudo apt install g++-12 g++-13 clang-15 clang-16 clang-17 clang-18
5151
- name: Checkout main boost
5252
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
5353
- name: Update tools/boostdep
@@ -140,76 +140,13 @@ jobs:
140140
- name: Test
141141
run: ../../../b2 toolset=$TOOLSET
142142
working-directory: ../boost-root/libs/type_traits/test
143-
ubuntu-focal:
144-
runs-on: ubuntu-20.04
145-
strategy:
146-
fail-fast: false
147-
matrix:
148-
compiler: [ g++-9, g++-10, clang++-9, clang++-10 ]
149-
standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ]
150-
steps:
151-
- uses: actions/checkout@v2
152-
with:
153-
fetch-depth: '0'
154-
- uses: mstachniuk/ci-skip@v1
155-
with:
156-
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
157-
commit-filter-separator: ';'
158-
fail-fast: true
159-
- name: Set TOOLSET
160-
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
161-
- name: Add repository
162-
continue-on-error: true
163-
id: addrepo
164-
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
165-
- name: Retry Add Repo
166-
continue-on-error: true
167-
id: retry1
168-
if: steps.addrepo.outcome=='failure'
169-
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
170-
- name: Retry Add Repo 2
171-
continue-on-error: true
172-
id: retry2
173-
if: steps.retry1.outcome=='failure'
174-
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
175-
- name: Install packages
176-
run: sudo apt install g++-9 g++-10 clang-9 clang-10
177-
- name: Checkout main boost
178-
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
179-
- name: Update tools/boostdep
180-
run: git submodule update --init tools/boostdep
181-
working-directory: ../boost-root
182-
- name: Copy files
183-
run: cp -r $GITHUB_WORKSPACE/* libs/type_traits
184-
working-directory: ../boost-root
185-
- name: Install deps
186-
run: python tools/boostdep/depinst/depinst.py type_traits
187-
working-directory: ../boost-root
188-
- name: Bootstrap
189-
run: ./bootstrap.sh
190-
working-directory: ../boost-root
191-
- name: Generate headers
192-
run: ./b2 headers
193-
working-directory: ../boost-root
194-
- name: Generate user config
195-
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
196-
working-directory: ../boost-root
197-
- name: Config info install
198-
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
199-
working-directory: ../boost-root/libs/config/test
200-
- name: Config info
201-
run: ./config_info_travis
202-
working-directory: ../boost-root/libs/config/test
203-
- name: Test
204-
run: ../../../b2 toolset=$TOOLSET
205-
working-directory: ../boost-root/libs/type_traits/test
206143
macos:
207144
runs-on: macos-latest
208145
strategy:
209146
fail-fast: false
210147
matrix:
211148
toolset: [ clang ]
212-
standard: [ "03", 11, 14, 17, 2a ]
149+
standard: [ "03", 11, 14, 17, 20 ]
213150
steps:
214151
- uses: actions/checkout@v2
215152
with:
@@ -467,79 +404,3 @@ jobs:
467404
- name: Test
468405
run: ..\..\..\b2 --hash cxxstd=${{ matrix.standard }} toolset=msvc-14.2 define=CI_SUPPRESS_KNOWN_ISSUES cxxflags=-clr asynch-exceptions=on
469406
working-directory: ../boost-root/libs/type_traits/test
470-
ubuntu-cuda:
471-
runs-on: ubuntu-20.04
472-
strategy:
473-
fail-fast: false
474-
matrix:
475-
standard: [ 11, 14, 17 ]
476-
steps:
477-
- uses: actions/checkout@v2
478-
with:
479-
fetch-depth: '0'
480-
- uses: Jimver/cuda-toolkit@v0.2.4
481-
- uses: mstachniuk/ci-skip@v1
482-
with:
483-
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
484-
commit-filter-separator: ';'
485-
fail-fast: true
486-
- name: Add repository
487-
continue-on-error: true
488-
id: addrepo
489-
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
490-
- name: Retry Add Repo
491-
continue-on-error: true
492-
id: retry1
493-
if: steps.addrepo.outcome=='failure'
494-
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
495-
- name: Retry Add Repo 2
496-
continue-on-error: true
497-
id: retry2
498-
if: steps.retry1.outcome=='failure'
499-
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
500-
- name: Install packages
501-
run: sudo apt install clang-10
502-
- name: Checkout main boost
503-
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
504-
- name: Update tools/boostdep
505-
run: git submodule update --init tools/boostdep
506-
working-directory: ../boost-root
507-
- name: Copy files
508-
run: cp -r $GITHUB_WORKSPACE/* libs/type_traits
509-
working-directory: ../boost-root
510-
- name: Install deps
511-
run: python tools/boostdep/depinst/depinst.py type_traits
512-
working-directory: ../boost-root
513-
- name: Bootstrap
514-
run: ./bootstrap.sh
515-
working-directory: ../boost-root
516-
- name: Generate headers
517-
run: ./b2 headers
518-
working-directory: ../boost-root
519-
- name: nvcc version
520-
run: nvcc --version
521-
working-directory: ../boost-root/libs/config/test
522-
- name: Testing nvcc
523-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cpp" && nvcc -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_VIA_STATIC_ASSERT $file.cpp || break -1; done
524-
working-directory: ../boost-root/libs/type_traits/test
525-
- name: Testing nvcc+clang
526-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cpp" && nvcc --compiler-bindir=clang++ -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_VIA_STATIC_ASSERT $file.cpp || break -1; done
527-
working-directory: ../boost-root/libs/type_traits/test
528-
- name: Create .cu files
529-
run: for file in $(cat cuda/cuda_tests.txt); do cp $file.cpp $file.cu; done
530-
working-directory: ../boost-root/libs/type_traits/test
531-
- name: Testing nvcc on .cu files
532-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cu" && nvcc -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_VIA_STATIC_ASSERT $file.cu || break -1; done
533-
working-directory: ../boost-root/libs/type_traits/test
534-
- name: Testing nvcc+clang on .cu files
535-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cu" && nvcc --compiler-bindir=clang++ -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_VIA_STATIC_ASSERT $file.cu || break -1; done
536-
working-directory: ../boost-root/libs/type_traits/test
537-
- name: Testing clang on .cu files
538-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cu" && clang++ -nocudalib --no-cuda-version-check --cuda-gpu-arch=sm_75 -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_VIA_STATIC_ASSERT $file.cu || break -1; done
539-
working-directory: ../boost-root/libs/type_traits/test
540-
- name: Testing nvcc on .cu files
541-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cu" && nvcc -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_CUDA_DEVICE $file.cu || break -1; done
542-
working-directory: ../boost-root/libs/type_traits/test
543-
- name: Testing clang on .cu files
544-
run: for file in $(cat cuda/cuda_tests.txt); do echo "testing $file.cu" && clang++ -nocudalib --no-cuda-version-check --cuda-gpu-arch=sm_75 -std=c++${{ matrix.standard }} -I../../.. -c -DTEST_CUDA_DEVICE $file.cu || break -1; done
545-
working-directory: ../boost-root/libs/type_traits/test

include/boost/type_traits/integral_constant.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ namespace boost{
6060
operator const mpl::integral_c<T, val>& ()const
6161
{
6262
static const char data[sizeof(long)] = { 0 };
63-
static const void* pdata = data;
64-
return *(reinterpret_cast<const mpl::integral_c<T, val>*>(pdata));
63+
const void* const pdata = data;
64+
return *static_cast<const mpl::integral_c<T, val>*>(pdata);
6565
}
66-
BOOST_CONSTEXPR operator T()const { return val; }
66+
BOOST_CONSTEXPR operator T()const BOOST_NOEXCEPT { return val; }
67+
BOOST_CONSTEXPR T operator()()const BOOST_NOEXCEPT { return val; }
6768
};
6869

6970
template <class T, T val>
@@ -80,10 +81,11 @@ namespace boost{
8081
operator const mpl::bool_<val>& ()const
8182
{
8283
static const char data[sizeof(long)] = { 0 };
83-
static const void* pdata = data;
84-
return *(reinterpret_cast<const mpl::bool_<val>*>(pdata));
84+
const void* const pdata = data;
85+
return *static_cast<const mpl::bool_<val>*>(pdata);
8586
}
86-
BOOST_CONSTEXPR operator bool()const { return val; }
87+
BOOST_CONSTEXPR operator bool()const BOOST_NOEXCEPT { return val; }
88+
BOOST_CONSTEXPR bool operator()()const BOOST_NOEXCEPT { return val; }
8789
};
8890

8991
template <bool val>

include/boost/type_traits/is_complete.hpp

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,18 @@
2727
* DO NOT MAKE GENERAL USE OF THIS TRAIT, AS THE COMPLETENESS OF A TYPE
2828
* VARIES ACROSS TRANSLATION UNITS AS WELL AS WITHIN A SINGLE UNIT.
2929
*
30-
*/
30+
*/
3131

3232
namespace boost {
3333

34-
3534
//
3635
// We will undef this if the trait isn't fully functional:
3736
//
3837
#define BOOST_TT_HAS_WORKING_IS_COMPLETE
3938

4039
#if !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1900) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40600)
4140

42-
namespace detail{
41+
namespace detail {
4342

4443
template <std::size_t N>
4544
struct ok_tag { double d; char c[N]; };
@@ -48,15 +47,15 @@ namespace boost {
4847
ok_tag<sizeof(T)> check_is_complete(int);
4948
template <class T>
5049
char check_is_complete(...);
51-
}
50+
51+
} // namespace detail
5252

5353
template <class T> struct is_complete
5454
: public integral_constant<bool, ::boost::is_function<typename boost::remove_reference<T>::type>::value || (sizeof(boost::detail::check_is_complete<T>(0)) != sizeof(char))> {};
5555

5656
#elif !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
5757

58-
namespace detail
59-
{
58+
namespace detail {
6059

6160
template <class T>
6261
struct is_complete_imp
@@ -70,19 +69,41 @@ namespace boost {
7069
static const bool value = sizeof(check<T>(0)) == sizeof(type_traits::yes_type);
7170
};
7271

73-
} // namespace detail
72+
} // namespace detail
7473

7574

7675
template <class T>
7776
struct is_complete : boost::integral_constant<bool, ::boost::is_function<typename boost::remove_reference<T>::type>::value || ::boost::detail::is_complete_imp<T>::value>
7877
{};
7978
template <class T>
8079
struct is_complete<T&> : boost::is_complete<T> {};
81-
80+
8281
#else
8382

84-
template <class T> struct is_complete
85-
: public boost::integral_constant<bool, true> {};
83+
namespace detail {
84+
85+
template <class T>
86+
struct is_complete_impl : public boost::true_type {};
87+
88+
template < >
89+
struct is_complete_impl<void> : public boost::false_type {};
90+
91+
template <class T>
92+
struct is_complete_impl<T[]> : public boost::false_type {};
93+
94+
template <class T>
95+
struct is_complete_impl<T&> : public is_complete_impl<T>::type {};
96+
97+
} // namespace detail
98+
99+
template <class T>
100+
struct is_complete : public detail::is_complete_impl<T>::type {};
101+
template <class T>
102+
struct is_complete<const T> : public detail::is_complete_impl<T>::type {};
103+
template <class T>
104+
struct is_complete<volatile T> : public detail::is_complete_impl<T>::type {};
105+
template <class T>
106+
struct is_complete<const volatile T> : public detail::is_complete_impl<T>::type {};
86107

87108
#undef BOOST_TT_HAS_WORKING_IS_COMPLETE
88109

test/integral_constant_test.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2025 DoctorNoobingstoneIPresume
2+
// Distributed under the Boost Software License, Version 1.0. (See
3+
// accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#include <boost/type_traits/integral_constant.hpp>
7+
#include <boost/type_traits/is_same.hpp>
8+
#include <boost/static_assert.hpp>
9+
10+
int main ()
11+
{
12+
// [2025-01-07] Adapted from example in https://en.cppreference.com/w/cpp/types/integral_constant ...
13+
14+
#ifndef BOOST_NO_CXX11_CONSTEXPR
15+
16+
using two_t = boost::integral_constant <int, 2>;
17+
using four_t = boost::integral_constant <int, 4>;
18+
19+
BOOST_STATIC_ASSERT ((! boost::is_same <two_t, four_t>::value));
20+
BOOST_STATIC_ASSERT ((two_t::value * 2 == four_t::value));
21+
BOOST_STATIC_ASSERT ((two_t () << 1 == four_t ()));
22+
BOOST_STATIC_ASSERT ((two_t () () << 1 == four_t () ()));
23+
24+
enum class E {e0, e1};
25+
using c0 = boost::integral_constant <E, E::e0>;
26+
using c1 = boost::integral_constant <E, E::e1>;
27+
BOOST_STATIC_ASSERT ((c0::value != E::e1));
28+
BOOST_STATIC_ASSERT ((c0 () == E::e0));
29+
BOOST_STATIC_ASSERT ((boost::is_same <c1, c1>::value));
30+
#endif
31+
}

0 commit comments

Comments
 (0)