mirror of
https://github.com/boostorg/integer.git
synced 2026-06-16 17:02:38 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e7ed9918c1 | |||
| becbd39cc4 | |||
| 28ba36fd3a |
+58
-42
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2021-2022 Andrey Semashev
|
# Copyright 2021-2023 Andrey Semashev
|
||||||
#
|
#
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||||
@@ -33,16 +33,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
# Linux, gcc
|
# Linux, gcc
|
||||||
- toolset: gcc-4.4
|
|
||||||
cxxstd: "98,0x"
|
|
||||||
os: ubuntu-latest
|
|
||||||
container: ubuntu:16.04
|
|
||||||
install:
|
|
||||||
- g++-4.4
|
|
||||||
sources:
|
|
||||||
- "ppa:ubuntu-toolchain-r/test"
|
|
||||||
- toolset: gcc-4.6
|
- toolset: gcc-4.6
|
||||||
cxxstd: "03,0x"
|
cxxstd: "0x"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
@@ -50,54 +42,54 @@ jobs:
|
|||||||
sources:
|
sources:
|
||||||
- "ppa:ubuntu-toolchain-r/test"
|
- "ppa:ubuntu-toolchain-r/test"
|
||||||
- toolset: gcc-4.7
|
- toolset: gcc-4.7
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- g++-4.7
|
- g++-4.7
|
||||||
- toolset: gcc-4.8
|
- toolset: gcc-4.8
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
- toolset: gcc-4.9
|
- toolset: gcc-4.9
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- g++-4.9
|
- g++-4.9
|
||||||
- toolset: gcc-5
|
- toolset: gcc-5
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "11,14,1z"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- g++-5
|
- g++-5
|
||||||
- toolset: gcc-6
|
- toolset: gcc-6
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "11,14,1z"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-6
|
- g++-6
|
||||||
- toolset: gcc-7
|
- toolset: gcc-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "11,14,17"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-7
|
- g++-7
|
||||||
- toolset: gcc-8
|
- toolset: gcc-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-8
|
- g++-8
|
||||||
- toolset: gcc-9
|
- toolset: gcc-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install:
|
install:
|
||||||
- g++-9
|
- g++-9
|
||||||
- toolset: gcc-10
|
- toolset: gcc-10
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install:
|
install:
|
||||||
- g++-10
|
- g++-10
|
||||||
@@ -123,63 +115,63 @@ jobs:
|
|||||||
# Linux, clang
|
# Linux, clang
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.5
|
compiler: clang++-3.5
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.5
|
- clang-3.5
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.6
|
compiler: clang++-3.6
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.6
|
- clang-3.6
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.7
|
compiler: clang++-3.7
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.7
|
- clang-3.7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.8
|
compiler: clang++-3.8
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.8
|
- clang-3.8
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.9
|
compiler: clang++-3.9
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-3.9
|
- clang-3.9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-4.0
|
compiler: clang++-4.0
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-4.0
|
- clang-4.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-5.0
|
compiler: clang++-5.0
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "11,14,1z"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-5.0
|
- clang-5.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-6.0
|
compiler: clang++-6.0
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "11,14,17"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-6.0
|
- clang-6.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-7
|
compiler: clang++-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "11,14,17"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
@@ -187,7 +179,7 @@ jobs:
|
|||||||
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
|
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-8
|
compiler: clang++-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
container: ubuntu:18.04
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
@@ -196,19 +188,19 @@ jobs:
|
|||||||
gcc_toolchain: 7
|
gcc_toolchain: 7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-9
|
compiler: clang++-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install:
|
install:
|
||||||
- clang-9
|
- clang-9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-10
|
compiler: clang++-10
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install:
|
install:
|
||||||
- clang-10
|
- clang-10
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-11
|
compiler: clang++-11
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-11
|
- clang-11
|
||||||
@@ -218,28 +210,32 @@ jobs:
|
|||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-12
|
- clang-12
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-13
|
compiler: clang++-13
|
||||||
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-13
|
- clang-13
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-14
|
compiler: clang++-14
|
||||||
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-14
|
- clang-14
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-15
|
compiler: clang++-15
|
||||||
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-15
|
- clang-15
|
||||||
sources:
|
- g++-11
|
||||||
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
|
gcc_toolchain: 11
|
||||||
source_keys:
|
|
||||||
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
|
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-15
|
compiler: clang++-15
|
||||||
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
@@ -248,15 +244,35 @@ jobs:
|
|||||||
- clang-15
|
- clang-15
|
||||||
- libc++-15-dev
|
- libc++-15-dev
|
||||||
- libc++abi-15-dev
|
- libc++abi-15-dev
|
||||||
|
cxxflags: -stdlib=libc++
|
||||||
|
linkflags: -stdlib=libc++
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-16
|
||||||
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
|
os: ubuntu-22.04
|
||||||
|
install:
|
||||||
|
- clang-16
|
||||||
sources:
|
sources:
|
||||||
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
|
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
|
||||||
|
source_keys:
|
||||||
|
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-16
|
||||||
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
|
os: ubuntu-22.04
|
||||||
|
install:
|
||||||
|
- clang-16
|
||||||
|
- libc++-16-dev
|
||||||
|
- libc++abi-16-dev
|
||||||
|
sources:
|
||||||
|
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
|
||||||
source_keys:
|
source_keys:
|
||||||
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
|
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
|
||||||
cxxflags: -stdlib=libc++
|
cxxflags: -stdlib=libc++
|
||||||
linkflags: -stdlib=libc++
|
linkflags: -stdlib=libc++
|
||||||
- name: UBSAN
|
- name: UBSAN
|
||||||
toolset: clang
|
toolset: clang
|
||||||
compiler: clang++-14
|
compiler: clang++-15
|
||||||
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||||
cxxflags: -stdlib=libc++
|
cxxflags: -stdlib=libc++
|
||||||
linkflags: -stdlib=libc++
|
linkflags: -stdlib=libc++
|
||||||
@@ -264,12 +280,12 @@ jobs:
|
|||||||
build_variant: debug
|
build_variant: debug
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-14
|
- clang-15
|
||||||
- libc++-14-dev
|
- libc++-15-dev
|
||||||
- libc++abi-14-dev
|
- libc++abi-15-dev
|
||||||
|
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: macos-11
|
os: macos-11
|
||||||
|
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|||||||
+5
-8
@@ -14,9 +14,6 @@ branches:
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
|
|
||||||
ADDRMD: 32
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
- TOOLSET: msvc-14.0
|
- TOOLSET: msvc-14.0
|
||||||
CXXSTD: 14,latest
|
CXXSTD: 14,latest
|
||||||
ADDRMD: 32,64
|
ADDRMD: 32,64
|
||||||
@@ -38,23 +35,23 @@ environment:
|
|||||||
CXXSTD: 14,17,latest
|
CXXSTD: 14,17,latest
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
- TOOLSET: gcc
|
- TOOLSET: gcc
|
||||||
CXXSTD: 03,11,14,1z
|
CXXSTD: 11,14,1z
|
||||||
ADDPATH: C:\cygwin\bin;
|
ADDPATH: C:\cygwin\bin;
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- TOOLSET: gcc
|
- TOOLSET: gcc
|
||||||
CXXSTD: 03,11,14,1z
|
CXXSTD: 11,14,1z
|
||||||
ADDPATH: C:\cygwin64\bin;
|
ADDPATH: C:\cygwin64\bin;
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- TOOLSET: gcc
|
- TOOLSET: gcc
|
||||||
CXXSTD: 03,11,14,1z
|
CXXSTD: 11,14,1z
|
||||||
ADDPATH: C:\mingw\bin;
|
ADDPATH: C:\mingw\bin;
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- TOOLSET: gcc
|
- TOOLSET: gcc
|
||||||
CXXSTD: 03,11,14,1z
|
CXXSTD: 11,14,1z
|
||||||
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- TOOLSET: gcc
|
- TOOLSET: gcc
|
||||||
CXXSTD: 03,11,14,1z
|
CXXSTD: 11,14,1z
|
||||||
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
|
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/core/swap.hpp>
|
#include <boost/core/invoke_swap.hpp>
|
||||||
#include <boost/core/enable_if.hpp>
|
#include <boost/core/enable_if.hpp>
|
||||||
|
|
||||||
namespace boost { namespace integer {
|
namespace boost { namespace integer {
|
||||||
@@ -38,7 +38,7 @@ extended_euclidean(Z m, Z n)
|
|||||||
if (m < n)
|
if (m < n)
|
||||||
{
|
{
|
||||||
swapped = true;
|
swapped = true;
|
||||||
boost::swap(m, n);
|
boost::core::invoke_swap(m, n);
|
||||||
}
|
}
|
||||||
Z u0 = m;
|
Z u0 = m;
|
||||||
Z u1 = 1;
|
Z u1 = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user