mirror of
https://github.com/boostorg/container_hash.git
synced 2026-01-20 16:32:28 +00:00
* 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
39 lines
774 B
C++
39 lines
774 B
C++
// 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();
|
|
}
|