Compare commits

...

26 Commits

Author SHA1 Message Date
Peter Dimov 2698b43803 Update revision history 2026-05-12 02:42:47 +03:00
Peter Dimov c745320880 Update .drone.jsonnet 2026-05-12 01:59:03 +03:00
Peter Dimov e32dbe5013 Update ci.yml 2026-05-11 22:46:20 +03:00
Peter Dimov 1e51179fc7 Disable hash_variant_test2 under Clang < 7.1 2026-05-11 22:32:13 +03:00
Peter Dimov 3e27ff182c Avoid libstdc++'s never valueless optimization 2026-05-11 22:08:25 +03:00
Peter Dimov 68fabb1a8e Do not throw an exception when hashing valueless std::variant values 2026-05-11 21:23:29 +03:00
Peter Dimov 8d5ae8536f Add a test for valueless std::variant values 2026-05-11 21:19:32 +03:00
Peter Dimov e3cbbebc8a Remove ubuntu:18.04 from ci.yml 2026-04-01 21:54:57 +03:00
Peter Dimov 12f8284c1a Update .drone.jsonnet 2026-04-01 21:54:57 +03:00
Peter Dimov 07fdcf16cb Update ci.yml 2026-04-01 21:54:57 +03:00
Peter Dimov bd3084a1c9 Update .drone.jsonnet 2026-04-01 21:54:57 +03:00
Peter Dimov 3a0f818eb8 Update ci.yml 2026-04-01 21:54:57 +03:00
Peter Dimov b2cb43dca0 Fix typo in README.md 2026-04-01 21:54:13 +03:00
Peter Dimov 828a53d8a4 Fix typo in intro.adoc 2026-04-01 19:58:55 +03:00
Peter Dimov 060d4aea6b Change sprintf to snprintf in benchmarks. Fixes #41. 2025-08-21 19:31:51 +03:00
Peter Dimov 186c38e255 Add benchmark/Jamfile 2025-08-21 19:26:00 +03:00
Peter Dimov c8dab7f85a Remove windows-2019 from GHA 2025-08-21 18:22:07 +03:00
Peter Dimov 5d8b8ac2b9 Add gcc-15, clang-20 to ci.yml 2025-06-09 00:05:15 +03:00
Peter Dimov 1e1cf6c46e Update ci.yml 2025-06-09 00:00:37 +03:00
Peter Dimov 88aacb6d46 Remove trailing whitespace 2025-06-08 23:23:14 +03:00
joaquintides 0a000167b7 Feature/hash_is_avalanching (#40)
* added hash_is_avalanching

* launched CI after enabling GHA

* moved 1.89 entry from Change Log to Recent Changes

* segregated some tests into hash_is_avalanching_test3.cpp and gotten rid of Unordered dependency

* removed unneeded include

* stopped using external std::hash for testing

* typo

* removed left over include

* typo

* moved hash_is_avalanching from boost::container_hash to boost

* fixed specializations of boost::hash_is_avalanching
2025-05-28 12:05:10 +03:00
Peter Dimov d8f1075080 Update ci.yml 2025-05-27 11:55:45 +03:00
Peter Dimov b8179488b2 Disable deprecation warning for has_denorm in hash_float_test.hpp 2024-12-13 04:30:43 +02:00
Peter Dimov edd436231a Update .drone.jsonnet 2024-12-13 04:13:53 +02:00
Peter Dimov d56fc37fe5 Apply Node20 workaround 2024-12-13 04:12:10 +02:00
Peter Dimov fa6601f974 Update ci.yml 2024-12-13 03:41:48 +02:00
19 changed files with 438 additions and 157 deletions
+71 -26
View File
@@ -34,7 +34,6 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch
'set -e', 'set -e',
'uname -a', 'uname -a',
'echo $DRONE_STAGE_MACHINE', 'echo $DRONE_STAGE_MACHINE',
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
] + ] +
(if sources != [] then [ 'apt-get update' ] + [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + (if sources != [] then [ 'apt-get update' ] + [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
@@ -103,7 +102,6 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"cppalliance/droneubuntu1404:1", "cppalliance/droneubuntu1404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '0x', ADDRMD: '32,64' }, { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '0x', ADDRMD: '32,64' },
"g++-4.7-multilib", "g++-4.7-multilib",
[ "ppa:ubuntu-toolchain-r/test" ],
), ),
linux_pipeline( linux_pipeline(
@@ -113,11 +111,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
), ),
linux_pipeline( linux_pipeline(
"Linux 14.04 GCC 4.9 32/64", "Linux 16.04 GCC 4.9 32/64",
"cppalliance/droneubuntu1404:1", "cppalliance/droneubuntu1604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11', ADDRMD: '32,64' }, { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11', ADDRMD: '32,64' },
"g++-4.9-multilib", "g++-4.9-multilib",
[ "ppa:ubuntu-toolchain-r/test" ],
), ),
linux_pipeline( linux_pipeline(
@@ -187,15 +184,15 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
), ),
linux_pipeline( linux_pipeline(
"Linux 23.04 GCC 13 32/64 UBSAN", "Linux 24.04 GCC 13 32/64 UBSAN",
"cppalliance/droneubuntu2304:1", "cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan,
"g++-13-multilib", "g++-13-multilib",
), ),
linux_pipeline( linux_pipeline(
"Linux 23.04 GCC 13 32 ASAN", "Linux 24.04 GCC 13 32 ASAN",
"cppalliance/droneubuntu2304:1", "cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan, { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan,
"g++-13-multilib", "g++-13-multilib",
), ),
@@ -214,6 +211,27 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"g++-14-multilib", "g++-14-multilib",
), ),
linux_pipeline(
"Linux 26.04 GCC 15 UBSAN",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
"g++-15-multilib",
),
linux_pipeline(
"Linux 26.04 GCC 15 ASAN",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c' } + asan,
"g++-15-multilib",
),
linux_pipeline(
"Linux 26.04 GCC 16",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-16', CXXSTD: '11,14,17,20,23,2c' },
"g++-16-multilib",
),
linux_pipeline( linux_pipeline(
"Linux 16.04 Clang 3.5", "Linux 16.04 Clang 3.5",
"cppalliance/droneubuntu1604:1", "cppalliance/droneubuntu1604:1",
@@ -334,38 +352,59 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
), ),
linux_pipeline( linux_pipeline(
"Linux 23.04 Clang 16", "Linux 24.04 Clang 16",
"cppalliance/droneubuntu2304:1", "cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' }, { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' },
"clang-16", "clang-16",
), ),
linux_pipeline( linux_pipeline(
"Linux 23.10 Clang 17 UBSAN", "Linux 24.04 Clang 17",
"cppalliance/droneubuntu2310:1", "cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan, { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' },
"clang-17", "clang-17",
), ),
linux_pipeline( linux_pipeline(
"Linux 23.10 Clang 17 ASAN", "Linux 24.04 Clang 18",
"cppalliance/droneubuntu2310:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan,
"clang-17",
),
linux_pipeline(
"Linux 24.04 Clang 18 UBSAN",
"cppalliance/droneubuntu2404:1", "cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan, { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' },
"clang-18", "clang-18",
), ),
linux_pipeline( linux_pipeline(
"Linux 24.04 Clang 18 ASAN", "Linux 24.04 Clang 19",
"cppalliance/droneubuntu2404:1", "cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan, { TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '11,14,17,20,2b' },
"clang-18", "clang-19",
),
linux_pipeline(
"Linux 24.04 Clang 20 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + ubsan,
"clang-20",
),
linux_pipeline(
"Linux 24.04 Clang 20 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,23,2c' } + asan,
"clang-20",
),
linux_pipeline(
"Linux 26.04 Clang 21",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '11,14,17,20,23,2c' },
"clang-21",
),
linux_pipeline(
"Linux 26.04 Clang 22",
"cppalliance/droneubuntu2604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-22', CXXSTD: '11,14,17,20,23,2c' },
"clang-22",
), ),
macos_pipeline( macos_pipeline(
@@ -413,4 +452,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"cppalliance/dronevs2022:1", "cppalliance/dronevs2022:1",
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' }, { TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
), ),
windows_pipeline(
"Windows VS2026 msvc-14.5",
"cppalliance/dronevs2026:1",
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' },
),
] ]
+97 -101
View File
@@ -17,116 +17,108 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- toolset: gcc-4.8
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-4.8-multilib
address-model: 32,64
- toolset: gcc-5
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-5-multilib
address-model: 32,64
- toolset: gcc-6
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-6-multilib
address-model: 32,64
- toolset: gcc-7 - toolset: gcc-7
cxxstd: "11,14,17" cxxstd: "11,14,17"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: g++-7-multilib install: g++-7-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-8 - toolset: gcc-8
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: g++-8-multilib install: g++-8-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-9 - toolset: gcc-9
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: g++-9-multilib install: g++-9-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-10 - toolset: gcc-10
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
os: ubuntu-22.04 container: ubuntu:22.04
os: ubuntu-latest
install: g++-10-multilib install: g++-10-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-11 - toolset: gcc-11
cxxstd: "11,14,17,20" cxxstd: "11,14,17,20"
os: ubuntu-22.04 container: ubuntu:22.04
os: ubuntu-latest
install: g++-11-multilib install: g++-11-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-12 - toolset: gcc-12
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04 container: ubuntu:22.04
os: ubuntu-latest
install: g++-12-multilib install: g++-12-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-13 - toolset: gcc-13
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:23.04
install: g++-13-multilib install: g++-13-multilib
address-model: 32,64 address-model: 32,64
- toolset: gcc-14 - toolset: gcc-14
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:24.04 container: ubuntu:24.04
os: ubuntu-latest
install: g++-14-multilib install: g++-14-multilib
address-model: 32,64 address-model: 32,64
- toolset: clang - toolset: gcc-15
compiler: clang++-3.9 cxxstd: "11,14,17,20,23,2c"
cxxstd: "11,14" container: ubuntu:26.04
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:18.04 install: g++-15-multilib
install: clang-3.9 address-model: 32,64
- toolset: clang - toolset: gcc-16
compiler: clang++-4.0 cxxstd: "11,14,17,20,23,2c"
cxxstd: "11,14" container: ubuntu:26.04
os: ubuntu-latest os: ubuntu-latest
container: ubuntu:18.04 install: g++-16-multilib
install: clang-4.0 address-model: 32,64
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-5.0
- toolset: clang - toolset: clang
compiler: clang++-6.0 compiler: clang++-6.0
cxxstd: "11,14,17" cxxstd: "11,14,17"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-6.0 install: clang-6.0
- toolset: clang - toolset: clang
compiler: clang++-7 compiler: clang++-7
cxxstd: "11,14,17" cxxstd: "11,14,17"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-7 install: clang-7
- toolset: clang - toolset: clang
compiler: clang++-8 compiler: clang++-8
cxxstd: "11,14,17" cxxstd: "11,14,17"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-8 install: clang-8
- toolset: clang - toolset: clang
compiler: clang++-9 compiler: clang++-9
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-9 install: clang-9
- toolset: clang - toolset: clang
compiler: clang++-10 compiler: clang++-10
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-10
- toolset: clang - toolset: clang
compiler: clang++-11 compiler: clang++-11
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-11
- toolset: clang - toolset: clang
compiler: clang++-12 compiler: clang++-12
cxxstd: "11,14,17,20" cxxstd: "11,14,17,20"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-12
- toolset: clang - toolset: clang
compiler: clang++-13 compiler: clang++-13
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
@@ -148,13 +140,13 @@ jobs:
- toolset: clang - toolset: clang
compiler: clang++-16 compiler: clang++-16
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04 container: ubuntu:24.04
os: ubuntu-latest os: ubuntu-latest
install: clang-16 install: clang-16
- toolset: clang - toolset: clang
compiler: clang++-17 compiler: clang++-17
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
container: ubuntu:23.10 container: ubuntu:24.04
os: ubuntu-latest os: ubuntu-latest
install: clang-17 install: clang-17
- toolset: clang - toolset: clang
@@ -164,14 +156,38 @@ jobs:
os: ubuntu-latest os: ubuntu-latest
install: clang-18 install: clang-18
- toolset: clang - toolset: clang
compiler: clang++-19
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
os: macos-12 container: ubuntu:24.04
os: ubuntu-latest
install: clang-19
- toolset: clang - toolset: clang
cxxstd: "11,14,17,20,2b" compiler: clang++-20
os: macos-13 cxxstd: "11,14,17,20,23,2c"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-20
- toolset: clang
compiler: clang++-21
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:26.04
os: ubuntu-latest
install: clang-21
- toolset: clang
compiler: clang++-22
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:26.04
os: ubuntu-latest
install: clang-22
- toolset: clang - toolset: clang
cxxstd: "11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
os: macos-14 os: macos-14
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-15
- toolset: clang
cxxstd: "11,14,17,20,23,2c"
os: macos-26
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
container: ${{matrix.container}} container: ${{matrix.container}}
@@ -181,17 +197,13 @@ jobs:
shell: bash shell: bash
steps: steps:
- name: Enable Node 16
run: |
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Setup container environment - name: Setup container environment
if: matrix.container if: matrix.container
run: | run: |
apt-get update apt-get update
apt-get -y install sudo python3 git g++ apt-get -y install sudo python3 git g++ curl xz-utils
- uses: actions/checkout@v6
- name: Install packages - name: Install packages
if: matrix.install if: matrix.install
@@ -238,31 +250,27 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- toolset: msvc-14.0
cxxstd: 14,latest
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3 - toolset: msvc-14.3
cxxstd: "14,17,20,latest" cxxstd: "14,17,20,latest"
addrmd: 32,64 addrmd: 32,64
os: windows-2022 os: windows-2022
- toolset: clang-win - toolset: msvc-14.5
cxxstd: "14,17,latest" cxxstd: "14,17,20,latest"
addrmd: 32,64 addrmd: 32,64
os: windows-2022 os: windows-2025-vs2026
- toolset: clang-win
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2025
- toolset: gcc - toolset: gcc
cxxstd: "11,14,17,2a" cxxstd: "11,14,17,2a"
addrmd: 64 addrmd: 64
os: windows-2019 os: windows-2025
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Setup Boost - name: Setup Boost
shell: cmd shell: cmd
@@ -298,16 +306,13 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-20.04 - os: ubuntu-latest
- os: ubuntu-22.04 - os: macos-latest
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Install packages - name: Install packages
if: matrix.install if: matrix.install
@@ -346,16 +351,13 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-20.04 - os: ubuntu-latest
- os: ubuntu-22.04 - os: macos-latest
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Install packages - name: Install packages
if: matrix.install if: matrix.install
@@ -404,16 +406,13 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-20.04 - os: ubuntu-latest
- os: ubuntu-22.04 - os: macos-latest
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Install packages - name: Install packages
if: matrix.install if: matrix.install
@@ -460,13 +459,12 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: windows-2019 - os: windows-latest
- os: windows-2022
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Setup Boost - name: Setup Boost
shell: cmd shell: cmd
@@ -509,13 +507,12 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: windows-2019 - os: windows-latest
- os: windows-2022
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Setup Boost - name: Setup Boost
shell: cmd shell: cmd
@@ -576,13 +573,12 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: windows-2019 - os: windows-latest
- os: windows-2022
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Setup Boost - name: Setup Boost
shell: cmd shell: cmd
+1 -1
View File
@@ -8,7 +8,7 @@ by C++11 as `std::hash`, and several support facilities (`hash_combine`,
`boost::hash` supports most standard types and some user-defined types out of `boost::hash` supports most standard types and some user-defined types out of
the box, and is extensible; it's possible for a user-defined type `X` to make the box, and is extensible; it's possible for a user-defined type `X` to make
iself hashable via `boost::hash<X>` by defining an appropriate overload of the itself hashable via `boost::hash<X>` by defining an appropriate overload of the
function `hash_value`. function `hash_value`.
See [the documentation of the library](https://www.boost.org/libs/container_hash) See [the documentation of the library](https://www.boost.org/libs/container_hash)
+18
View File
@@ -0,0 +1,18 @@
# Copyright Daniel James 2005. Use, modification, and distribution are
# subject to 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)
import testing ;
project :
requirements
<library>/boost/container_hash//boost_container_hash
<library>/boost/core//boost_core
<library>/boost/unordered//boost_unordered
;
link char_seq.cpp ;
link unordered.cpp ;
link unordered_flat.cpp : <cxxstd>11:<build>no <cxxstd>14:<build>no ;
link word_count.cpp : <cxxstd>11:<build>no <cxxstd>14:<build>no ;
+2 -2
View File
@@ -79,11 +79,11 @@ int main()
if( k & 1 ) if( k & 1 )
{ {
sprintf( buffer, "prefix_%llu_suffix", k ); std::snprintf( buffer, sizeof( buffer ), "prefix_%llu_suffix", k );
} }
else else
{ {
sprintf( buffer, "{%u}", static_cast<unsigned>( k ) ); std::snprintf( buffer, sizeof( buffer ), "{%u}", static_cast<unsigned>( k ) );
} }
v.push_back( buffer ); v.push_back( buffer );
+2 -2
View File
@@ -356,11 +356,11 @@ int main()
if( k & 1 ) if( k & 1 )
{ {
sprintf( buffer, "prefix_%llu_suffix", k ); std::snprintf( buffer, sizeof( buffer ), "prefix_%llu_suffix", k );
} }
else else
{ {
sprintf( buffer, "{%u}", static_cast<unsigned>( k ) ); std::snprintf( buffer, sizeof( buffer ), "{%u}", static_cast<unsigned>( k ) );
} }
v.push_back( buffer ); v.push_back( buffer );
+1 -1
View File
@@ -44,7 +44,7 @@ Out of the box, `boost::hash` supports
* `std::variant`, `std::monostate`. * `std::variant`, `std::monostate`.
`boost::hash` is extensible; it's possible for a user-defined type `X` to make `boost::hash` is extensible; it's possible for a user-defined type `X` to make
iself hashable via `boost::hash<X>` by defining an appropriate overload of the itself hashable via `boost::hash<X>` by defining an appropriate overload of the
function `hash_value`. Many, if not most, Boost types already contain the function `hash_value`. Many, if not most, Boost types already contain the
necessary support. necessary support.
+8
View File
@@ -8,6 +8,14 @@ https://www.boost.org/LICENSE_1_0.txt
= Recent Changes = Recent Changes
:idprefix: recent_ :idprefix: recent_
== Boost 1.92.0
* Hashing a valueless `std::variant` instance no longer throws.
== Boost 1.89.0
* Added the `hash_is_avalanching` trait class.
== Boost 1.84.0 == Boost 1.84.0
* {cpp}03 is no longer supported. * {cpp}03 is no longer supported.
+53 -1
View File
@@ -1,7 +1,7 @@
//// ////
Copyright 2005-2008 Daniel James Copyright 2005-2008 Daniel James
Copyright 2022 Christian Mazakas Copyright 2022 Christian Mazakas
Copyright 2022 Peter Dimov Copyright 2022, 2025 Peter Dimov
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt https://www.boost.org/LICENSE_1_0.txt
//// ////
@@ -44,6 +44,8 @@ template<class It> std::size_t hash_range( It first, It last );
template<class It> void hash_unordered_range( std::size_t& seed, It first, It last ); template<class It> void hash_unordered_range( std::size_t& seed, It first, It last );
template<class It> std::size_t hash_unordered_range( It first, It last ); template<class It> std::size_t hash_unordered_range( It first, It last );
template<class Hash> struct hash_is_avalanching;
} // namespace boost } // namespace boost
---- ----
@@ -572,6 +574,56 @@ where `x` is the currently contained value in `v`.
Throws: :: Throws: ::
`std::bad_variant_access` when `v.valueless_by_exception()` is `true`. `std::bad_variant_access` when `v.valueless_by_exception()` is `true`.
== <boost/container_hash/{zwsp}hash_is_avalanching.hpp>
Defines the trait `boost::hash_is_avalanching`.
[source]
----
namespace boost
{
template<class Hash> struct hash_is_avalanching;
} // namespace boost
----
=== hash_is_avalanching<Hash>
[source]
----
template<class Hash> struct hash_is_avalanching
{
static constexpr bool value = /* see below */;
};
----
`hash_is_avalanching<Hash>::value` is:
* `false` if `Hash::is_avalanching` is not present,
* `Hash::is_avalanching::value` if this is present and convertible at compile time to a `bool`,
* `true` if `Hash::is_avalanching` is `void` (this usage is deprecated),
* ill-formed otherwise.
A hash function is said to have the _avalanching property_ if small changes
in the input translate to large changes in the returned hash code
&#8212;ideally, flipping one bit in the representation of the input value results
in each bit of the hash code flipping with probability 50%. Libraries
such as link:../../../unordered/index.html[Boost.Unordered] consult this trait
to determine if the supplied hash function is of high quality.
`boost::hash` for `std::basic_string<Ch>` and `std::basic_string_view<Ch>`
has this trait set to `true` when `Ch` is an integral type (this includes
`std::string` and `std::string_view`, among others).
Users can set this trait for a particular `Hash` type by:
* Inserting the nested `is_avalanching` typedef in the class definition
if they have access to its source code.
* Writing a specialization of `boost::hash_is_avalanching`
for `Hash`.
Note that usage of this trait is not restricted to hash functions produced
with Boost.ContainerHash.
== <boost/container_hash/{zwsp}is_range.hpp> == <boost/container_hash/{zwsp}is_range.hpp>
Defines the trait `boost::container_hash::is_range`. Defines the trait `boost::container_hash::is_range`.
+10 -9
View File
@@ -1,5 +1,5 @@
// Copyright 2005-2014 Daniel James. // Copyright 2005-2014 Daniel James.
// Copyright 2021, 2022 Peter Dimov. // Copyright 2021, 2022, 2025 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt // https://www.boost.org/LICENSE_1_0.txt
@@ -11,6 +11,7 @@
#define BOOST_FUNCTIONAL_HASH_HASH_HPP #define BOOST_FUNCTIONAL_HASH_HASH_HPP
#include <boost/container_hash/hash_fwd.hpp> #include <boost/container_hash/hash_fwd.hpp>
#include <boost/container_hash/hash_is_avalanching.hpp>
#include <boost/container_hash/is_range.hpp> #include <boost/container_hash/is_range.hpp>
#include <boost/container_hash/is_contiguous_range.hpp> #include <boost/container_hash/is_contiguous_range.hpp>
#include <boost/container_hash/is_unordered_range.hpp> #include <boost/container_hash/is_unordered_range.hpp>
@@ -454,7 +455,11 @@ namespace boost
std::size_t seed = 0; std::size_t seed = 0;
hash_combine( seed, v.index() ); hash_combine( seed, v.index() );
std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
if( !v.valueless_by_exception() )
{
std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
}
return seed; return seed;
} }
@@ -557,19 +562,15 @@ namespace boost
#endif #endif
// boost::unordered::hash_is_avalanching // hash_is_avalanching
namespace unordered template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string<Ch> > >: std::is_integral<Ch> {};
{
template<class T> struct hash_is_avalanching;
template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string<Ch> > >: std::is_integral<Ch> {};
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string_view<Ch> > >: std::is_integral<Ch> {}; template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string_view<Ch> > >: std::is_integral<Ch> {};
#endif #endif
} // namespace unordered
} // namespace boost } // namespace boost
+3 -1
View File
@@ -1,5 +1,5 @@
// Copyright 2005-2009 Daniel James. // Copyright 2005-2009 Daniel James.
// Copyright 2021, 2022 Peter Dimov. // Copyright 2021, 2022, 2025 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt // https://www.boost.org/LICENSE_1_0.txt
@@ -32,6 +32,8 @@ template<class It> std::size_t hash_range( It, It );
template<class It> void hash_unordered_range( std::size_t&, It, It ); template<class It> void hash_unordered_range( std::size_t&, It, It );
template<class It> std::size_t hash_unordered_range( It, It ); template<class It> std::size_t hash_unordered_range( It, It );
template<class Hash> struct hash_is_avalanching;
} // namespace boost } // namespace boost
#endif // #ifndef BOOST_FUNCTIONAL_HASH_FWD_HPP #endif // #ifndef BOOST_FUNCTIONAL_HASH_FWD_HPP
@@ -0,0 +1,57 @@
// Copyright 2025 Joaquin M Lopez Munoz.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED
#define BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED
#include <type_traits>
namespace boost
{
namespace hash_detail
{
template<class... Ts> struct make_void
{
using type = void;
};
template<class... Ts> using void_t = typename make_void<Ts...>::type;
template<class IsAvalanching> struct avalanching_value
{
static constexpr bool value = IsAvalanching::value;
};
// may be explicitly marked as BOOST_DEPRECATED in the future
template<> struct avalanching_value<void>
{
static constexpr bool value = true;
};
template<class Hash, class = void> struct hash_is_avalanching_impl: std::false_type
{
};
template<class Hash> struct hash_is_avalanching_impl<Hash, void_t<typename Hash::is_avalanching> >:
std::integral_constant<bool, avalanching_value<typename Hash::is_avalanching>::value>
{
};
template<class Hash>
struct hash_is_avalanching_impl<Hash, typename std::enable_if< ((void)Hash::is_avalanching, true) >::type>
{
// Hash::is_avalanching is not a type: we don't define value to produce
// a compile error downstream
};
} // namespace hash_detail
template<class Hash> struct hash_is_avalanching: hash_detail::hash_is_avalanching_impl<Hash>::type
{
};
} // namespace boost
#endif // #ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright 2018, 2019, 2021, 2022 Peter Dimov # Copyright 2018, 2019, 2021, 2022, 2025 Peter Dimov
# 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://www.boost.org/LICENSE_1_0.txt # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
@@ -7,6 +7,6 @@ include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
if(HAVE_BOOST_TEST) if(HAVE_BOOST_TEST)
boost_test_jamfile(FILE Jamfile.v2 boost_test_jamfile(FILE Jamfile.v2
LINK_LIBRARIES Boost::container_hash Boost::core Boost::utility Boost::unordered) LINK_LIBRARIES Boost::container_hash Boost::core Boost::utility)
endif() endif()
+6 -5
View File
@@ -1,5 +1,5 @@
# Copyright 2005-2012 Daniel James. # Copyright 2005-2012 Daniel James.
# Copyright 2022 Peter Dimov # Copyright 2022, 2025 Peter Dimov
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt # https://www.boost.org/LICENSE_1_0.txt
@@ -119,10 +119,9 @@ run is_described_class_test3.cpp
run described_class_test.cpp run described_class_test.cpp
: : : <warnings>extra ; : : : <warnings>extra ;
run hash_is_avalanching_test.cpp run hash_is_avalanching_test.cpp ;
/boost/unordered//boost_unordered ; run hash_is_avalanching_test2.cpp ;
run hash_is_avalanching_test2.cpp run hash_is_avalanching_test3.cpp ;
/boost/unordered//boost_unordered ;
run hash_integral_test2.cpp ; run hash_integral_test2.cpp ;
@@ -136,3 +135,5 @@ run hash_tuple_like_test2.cpp
run is_range_test4.cpp ; run is_range_test4.cpp ;
run hash_container_test2.cpp ; run hash_container_test2.cpp ;
run hash_variant_test2.cpp ;
+5
View File
@@ -33,6 +33,11 @@
#pragma GCC diagnostic ignored "-Wfloat-equal" #pragma GCC diagnostic ignored "-Wfloat-equal"
#endif #endif
#if defined(__clang__)
// P2614 deprecates has_denorm in C++23
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
char const* float_type(float*) { return "float"; } char const* float_type(float*) { return "float"; }
char const* float_type(double*) { return "double"; } char const* float_type(double*) { return "double"; }
char const* float_type(long double*) { return "long double"; } char const* float_type(long double*) { return "long double"; }
+3 -3
View File
@@ -1,10 +1,10 @@
// Copyright 2022 Peter Dimov. // Copyright 2022, 2025 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt // https://www.boost.org/LICENSE_1_0.txt
#include <boost/container_hash/hash.hpp> #include <boost/container_hash/hash.hpp>
#include <boost/container_hash/hash_is_avalanching.hpp>
#include <boost/core/lightweight_test_trait.hpp> #include <boost/core/lightweight_test_trait.hpp>
#include <boost/unordered/hash_traits.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <string> #include <string>
@@ -12,7 +12,7 @@ enum my_char { min = 0, max = 255 };
int main() int main()
{ {
using boost::unordered::hash_is_avalanching; using boost::hash_is_avalanching;
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::string> > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::string> > ));
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::wstring> > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::wstring> > ));
+3 -3
View File
@@ -1,8 +1,9 @@
// Copyright 2022 Peter Dimov. // Copyright 2022, 2025 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt // https://www.boost.org/LICENSE_1_0.txt
#include <boost/container_hash/hash.hpp> #include <boost/container_hash/hash.hpp>
#include <boost/container_hash/hash_is_avalanching.hpp>
#include <boost/core/lightweight_test_trait.hpp> #include <boost/core/lightweight_test_trait.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/config/pragma_message.hpp> #include <boost/config/pragma_message.hpp>
@@ -14,14 +15,13 @@ int main() {}
#else #else
#include <boost/unordered/hash_traits.hpp>
#include <string_view> #include <string_view>
enum my_char { min = 0, max = 255 }; enum my_char { min = 0, max = 255 };
int main() int main()
{ {
using boost::unordered::hash_is_avalanching; using boost::hash_is_avalanching;
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::string_view> > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::string_view> > ));
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::wstring_view> > )); BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::wstring_view> > ));
+38
View File
@@ -0,0 +1,38 @@
// Copyright 2025 Joaquin M Lopez Munoz.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/container_hash/hash_is_avalanching.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <type_traits>
struct X
{
using is_avalanching = void;
};
struct Y
{
using is_avalanching = std::true_type;
};
struct Z
{
using is_avalanching = std::false_type;
};
struct W
{
};
int main()
{
using boost::hash_is_avalanching;
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< X > ));
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< Y > ));
BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< Z > ));
BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< W > ));
return boost::report_errors();
}
+58
View File
@@ -0,0 +1,58 @@
// Copyright 2026 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/container_hash/hash.hpp>
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX17_HDR_VARIANT)
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_CXX17_HDR_VARIANT is defined" )
int main() {}
#elif defined(BOOST_CLANG_VERSION) && BOOST_CLANG_VERSION < 70100
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_CLANG_VERSION < 70100" )
int main() {}
#else
#include <boost/core/lightweight_test.hpp>
#include <variant>
#include <set>
struct X
{
operator std::set<float>() const { throw 5; }
};
using V = std::variant<std::set<int>, std::set<float>>;
V make_valueless_variant()
{
V v;
try
{
v.emplace<1>( X() );
}
catch( int )
{
}
BOOST_TEST( v.valueless_by_exception() );
return v;
}
int main()
{
V v1, v2 = make_valueless_variant();
BOOST_TEST_NE( (boost::hash<V>()( v1 )), (boost::hash<V>()( v2 )) );
return boost::report_errors();
}
#endif