Compare commits

...

31 Commits

Author SHA1 Message Date
Peter Dimov
1193ed067c Add VERBATIM to add_custom_target 2024-08-21 01:45:25 +03:00
Peter Dimov
f85cb77bd3 Update build.jam, test/Jamfile 2024-08-20 21:50:38 +03:00
Rene Rivera
7d68e5f1d2 Sync from upstream. 2024-08-20 09:58:45 -05:00
Peter Dimov
3c9ce69f92 Update .drone.jsonnet 2024-08-18 11:36:04 +03:00
Peter Dimov
aa2e8b3674 Update ci.yml 2024-08-17 18:25:36 +03:00
Rene Rivera
c3cb5896fc Update build dependencies. 2024-07-31 23:25:37 -05:00
Rene Rivera
58cd5e35b1 Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:24 -05:00
Rene Rivera
386d007088 Update copyright dates. 2024-07-20 22:52:05 -05:00
Rene Rivera
b8090f9b87 Bump B2 require to 5.2 2024-06-14 11:33:55 -05:00
Rene Rivera
a5c2949670 Add missing test deps. 2024-05-14 07:33:03 -05:00
Rene Rivera
b16f42ef10 Update dependencies. 2024-05-13 21:44:55 -05:00
Rene Rivera
de85b0c248 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
Rene Rivera
583e14413c Add missing b2 testing module import. 2024-04-25 08:28:42 -05:00
Rene Rivera
ef914e1b34 Sync from upstream. 2024-04-20 15:34:07 -05:00
Peter Dimov
ee5285bfa6 Revert "Update doc/Jamfile"
This reverts commit 0a9803dffe.
2024-04-16 22:36:47 +03:00
Peter Dimov
0a9803dffe Update doc/Jamfile 2024-04-16 22:16:44 +03:00
Rene Rivera
881448f75e Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:15:58 -05:00
Rene Rivera
c5b1f4894c Make the library modular usable. 2024-03-11 08:31:12 -05:00
Peter Dimov
6d214eb776 Update .appveyor.yml 2024-03-06 05:13:53 +02:00
Peter Dimov
b0d3107b99 Disable hash_fs_path_test for mingw32 2024-03-06 02:16:51 +02:00
Peter Dimov
e2446b187e Update .drone.jsonnet 2024-03-05 20:24:49 +02:00
Peter Dimov
1dd2f73866 Disable is_range_test2 for gcc-4.7 2024-03-05 19:20:47 +02:00
Peter Dimov
1278f1c2b5 Update .drone.jsonnet 2024-03-05 19:11:58 +02:00
Peter Dimov
067f636d6c Disable hash_fs_path_test for gcc-4.7 2024-03-05 19:09:43 +02:00
Peter Dimov
338c053889 Fix hash_is_avalanching_test2 for libc++ 16 and later 2024-03-05 19:07:24 +02:00
Peter Dimov
94d4f7cb88 Avoid -Wsign-conversion under GCC 6/7 2024-03-05 18:43:35 +02:00
Peter Dimov
6957a20ab1 Avoid compilation errors caused by iterator_traits<void*>. Refs #36. 2024-03-05 18:19:19 +02:00
Peter Dimov
28cc18a4bc Add test with types that return void* from begin/end. Refs #36. 2024-03-05 17:44:03 +02:00
Peter Dimov
7288df8bee Fix is_tuple_like for cv-qualified types under old compilers 2023-12-08 02:00:22 +02:00
Peter Dimov
5c2d5e5b36 Test is_tuple_like with const-qualified types 2023-12-07 22:32:10 +02:00
Peter Dimov
db8743e1c3 Update ci.yml 2023-12-07 22:21:26 +02:00
14 changed files with 246 additions and 56 deletions

View File

@@ -34,18 +34,18 @@ environment:
ADDPATH: C:\cygwin\bin;
TOOLSET: gcc
CXXSTD: 11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
ADDPATH: C:\cygwin64\bin;
TOOLSET: gcc
CXXSTD: 11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\mingw\bin;
CXXSTD: 11,14,17
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
ADDPATH: C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;
TOOLSET: gcc
CXXSTD: 11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
CXXSTD: 11,14,17
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
TOOLSET: gcc
CXXSTD: 11,14,1z
CXXSTD: 11,14,17
install:
- set BOOST_BRANCH=develop

View File

@@ -180,26 +180,40 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
),
linux_pipeline(
"Linux 22.04 GCC 12 32 ASAN",
"Linux 22.04 GCC 12 32/64",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan,
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' },
"g++-12-multilib",
),
linux_pipeline(
"Linux 22.04 GCC 12 64 ASAN",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan,
"g++-12-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32/64",
"Linux 23.04 GCC 13 32/64 UBSAN",
"cppalliance/droneubuntu2304:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' },
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32 ASAN",
"cppalliance/droneubuntu2304:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b' } + ubsan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b' } + asan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 16.04 Clang 3.5",
"cppalliance/droneubuntu1604:1",
@@ -313,16 +327,9 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
),
linux_pipeline(
"Linux 22.04 Clang 15 UBSAN",
"Linux 22.04 Clang 15",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' } + ubsan,
"clang-15",
),
linux_pipeline(
"Linux 22.04 Clang 15 ASAN",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' } + asan,
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' },
"clang-15",
),
@@ -333,6 +340,34 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
"clang-16",
),
linux_pipeline(
"Linux 23.10 Clang 17 UBSAN",
"cppalliance/droneubuntu2310:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan,
"clang-17",
),
linux_pipeline(
"Linux 23.10 Clang 17 ASAN",
"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",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan,
"clang-18",
),
linux_pipeline(
"Linux 24.04 Clang 18 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan,
"clang-18",
),
macos_pipeline(
"MacOS 10.15 Xcode 12.2 UBSAN",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + ubsan,
@@ -358,7 +393,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
windows_pipeline(
"Windows VS2015 msvc-14.0",
"cppalliance/dronevs2015",
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' },
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
),
windows_pipeline(

View File

@@ -71,6 +71,12 @@ jobs:
container: ubuntu:23.04
install: g++-13-multilib
address-model: 32,64
- toolset: gcc-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:24.04
install: g++-14-multilib
address-model: 32,64
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
@@ -124,33 +130,48 @@ jobs:
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
container: ubuntu:22.04
os: ubuntu-latest
install: clang-15
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:23.04
os: ubuntu-latest
install: clang-16
- toolset: clang
cxxstd: "11,14,17,2a"
os: macos-11
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.10
os: ubuntu-latest
install: clang-17
- toolset: clang
compiler: clang++-18
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-18
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-12
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
@@ -160,6 +181,10 @@ jobs:
shell: bash
steps:
- name: Enable Node 16
run: |
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Setup container environment
@@ -237,7 +262,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -275,14 +300,14 @@ jobs:
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
- os: macos-11
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
@@ -323,14 +348,14 @@ jobs:
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
- os: macos-11
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
@@ -381,14 +406,14 @@ jobs:
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
- os: macos-11
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
@@ -441,7 +466,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -490,7 +515,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -557,7 +582,7 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd

22
build.jam Normal file
View File

@@ -0,0 +1,22 @@
# Copyright 2023-2024 René Ferdinand Rivera Morell
# Copyright 2024 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
require-b2 5.2 ;
constant boost_dependencies :
/boost/config//boost_config
/boost/describe//boost_describe
/boost/mp11//boost_mp11
;
project /boost/container_hash ;
explicit
[ alias boost_container_hash : : : : <include>include <library>$(boost_dependencies) ]
[ alias all : boost_container_hash examples test ]
;
call-if : boost-library container_hash
;

View File

@@ -3,8 +3,12 @@
# 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 ;
run books.cpp ;
run point.cpp ;
run portable.cpp ;
run template.cpp : : : <toolset>msvc-8.0:<build>no ;
run template.cpp /boost/unordered//boost_unordered : : : <toolset>msvc-8.0:<build>no ;
run point2.cpp ;

View File

@@ -14,8 +14,12 @@ namespace boost
namespace hash_detail
{
template<class T> struct iterator_traits: std::iterator_traits<T> {};
template<> struct iterator_traits< void* > {};
template<> struct iterator_traits< void const* > {};
template<class T, class It>
std::integral_constant< bool, !std::is_same<typename std::remove_cv<T>::type, typename std::iterator_traits<It>::value_type>::value >
std::integral_constant< bool, !std::is_same<typename std::remove_cv<T>::type, typename iterator_traits<It>::value_type>::value >
is_range_check( It first, It last );
template<class T> decltype( is_range_check<T>( std::declval<T const&>().begin(), std::declval<T const&>().end() ) ) is_range_( int );

View File

@@ -26,7 +26,7 @@ template<class T> struct is_tuple_like_<T, std::integral_constant<bool, std::tup
namespace container_hash
{
template<class T> struct is_tuple_like: hash_detail::is_tuple_like_<T>
template<class T> struct is_tuple_like: hash_detail::is_tuple_like_< typename std::remove_cv<T>::type >
{
};

View File

@@ -10,6 +10,10 @@ local clang-flags = $(gcc-flags) -Wno-c99-extensions ;
project hash-tests
: requirements
<library>/boost/container_hash//boost_container_hash
<library>/boost/core//boost_core
<library>/boost/type_traits//boost_type_traits
<warnings>pedantic
<toolset>intel:<warnings>on
<toolset>gcc:<cxxflags>$(gcc-flags)
@@ -72,13 +76,17 @@ run quick.cpp ;
run hash_number_test2.cpp ;
run hash_integral_test.cpp ;
run hash_string_test2.cpp ;
run hash_string_test2.cpp
/boost/utility//boost_utility ;
# for gcc-4.8
local fs-path-req = "-<toolset>gcc:<cxxflags>-Wshadow" "-<toolset>gcc:<cxxflags>-Wconversion" ;
local fs-path-req = "-<toolset>gcc:<cxxflags>-Wshadow" "-<toolset>gcc:<cxxflags>-Wconversion" <toolset>gcc-4.7:<build>no ;
run hash_fs_path_test.cpp /boost//filesystem/<warnings>off : : : $(fs-path-req) <toolset>msvc-14.0,<cxxstd>latest:<build>no <toolset>msvc-8.0:<build>no <undefined-sanitizer>norecover:<link>static ;
run is_range_test2.cpp : : : $(fs-path-req) <toolset>msvc-8.0:<build>no ;
run hash_fs_path_test.cpp /boost/filesystem//boost_filesystem/<warnings>off : : : $(fs-path-req)
<toolset>msvc-14.0,<cxxstd>latest:<build>no
<undefined-sanitizer>norecover:<link>static ;
run is_range_test2.cpp /boost/filesystem//boost_filesystem : : : $(fs-path-req) ;
run hash_container_test.cpp ;
@@ -113,8 +121,10 @@ run is_described_class_test3.cpp
run described_class_test.cpp
: : : <warnings>extra ;
run hash_is_avalanching_test.cpp ;
run hash_is_avalanching_test2.cpp ;
run hash_is_avalanching_test.cpp
/boost/unordered//boost_unordered ;
run hash_is_avalanching_test2.cpp
/boost/unordered//boost_unordered ;
run hash_integral_test2.cpp ;
@@ -125,3 +135,6 @@ run is_tuple_like_test.cpp ;
run hash_tuple_like_test.cpp ;
run hash_tuple_like_test2.cpp
: : : <warnings>extra ;
run is_range_test4.cpp ;
run hash_container_test2.cpp ;

View File

@@ -14,4 +14,4 @@ target_link_libraries(quick Boost::container_hash)
enable_testing()
add_test(quick quick)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -18,4 +18,4 @@ target_link_libraries(quick Boost::container_hash)
enable_testing()
add_test(quick quick)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,39 @@
// Copyright 2024 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/core/lightweight_test.hpp>
struct X1
{
void* begin() const { return nullptr; }
void* end() const { return nullptr; }
};
std::size_t hash_value( X1 const& )
{
return 1;
}
struct X2
{
void const* begin() const { return nullptr; }
void const* end() const { return nullptr; }
};
std::size_t hash_value( X2 const& )
{
return 2;
}
int main()
{
X1 x1;
BOOST_TEST_EQ( boost::hash<X1>()( x1 ), 1u );
X2 x2;
BOOST_TEST_EQ( boost::hash<X2>()( x2 ), 2u );
return boost::report_errors();
}

View File

@@ -44,7 +44,11 @@ int main()
#endif
#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 160000
// std::char_traits<Ch> is deprecated for non-char types
#else
BOOST_TEST_TRAIT_FALSE(( hash_is_avalanching< boost::hash<std::basic_string_view<my_char> > > ));
#endif
return boost::report_errors();
}

28
test/is_range_test4.cpp Normal file
View File

@@ -0,0 +1,28 @@
// Copyright 2024 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/container_hash/is_range.hpp>
#include <boost/core/lightweight_test_trait.hpp>
struct X1
{
void* begin() const;
void* end() const;
};
struct X2
{
void const* begin() const;
void const* end() const;
};
int main()
{
using boost::container_hash::is_range;
BOOST_TEST_TRAIT_FALSE((is_range<X1>));
BOOST_TEST_TRAIT_FALSE((is_range<X2>));
return boost::report_errors();
}

View File

@@ -70,20 +70,36 @@ int main()
using boost::container_hash::is_tuple_like;
BOOST_TEST_TRAIT_FALSE((is_tuple_like<void>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<void const>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<int>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<int const>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<X>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<X const>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<int[2]>));
BOOST_TEST_TRAIT_FALSE((is_tuple_like<int const [2]>));
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1800)
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::pair<int, X> >));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::pair<int, X> const>));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<> >));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<> const>));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<X> >));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<X> const>));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<X, X> >));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<X, X> const>));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<X, X, X> >));
BOOST_TEST_TRAIT_TRUE((is_tuple_like< std::tuple<X, X, X> const>));
BOOST_TEST_TRAIT_TRUE((is_tuple_like<user::Y>));
BOOST_TEST_TRAIT_TRUE((is_tuple_like<user::Y const>));
#endif