diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..76236f8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright 2018 Mike Dev +# 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 + +cmake_minimum_required(VERSION 3.5) +project(BoostContainerHash LANGUAGES CXX) + +add_library(boost_container_hash INTERFACE) +add_library(Boost::container_hash ALIAS boost_container_hash) + +target_include_directories(boost_container_hash INTERFACE include) + +target_link_libraries(boost_container_hash + INTERFACE + Boost::assert + Boost::config + Boost::core + Boost::detail + Boost::integer + Boost::static_assert + Boost::type_traits +) + diff --git a/include/boost/container_hash/extensions.hpp b/include/boost/container_hash/extensions.hpp index 4eebb4b..393b702 100644 --- a/include/boost/container_hash/extensions.hpp +++ b/include/boost/container_hash/extensions.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #if !defined(BOOST_NO_CXX11_HDR_ARRAY) # include @@ -71,56 +70,6 @@ namespace boost return seed; } - inline std::size_t hash_range( - std::vector::iterator first, - std::vector::iterator last) - { - std::size_t seed = 0; - - for(; first != last; ++first) - { - hash_combine(seed, *first); - } - - return seed; - } - - inline std::size_t hash_range( - std::vector::const_iterator first, - std::vector::const_iterator last) - { - std::size_t seed = 0; - - for(; first != last; ++first) - { - hash_combine(seed, *first); - } - - return seed; - } - - inline void hash_range( - std::size_t& seed, - std::vector::iterator first, - std::vector::iterator last) - { - for(; first != last; ++first) - { - hash_combine(seed, *first); - } - } - - inline void hash_range( - std::size_t& seed, - std::vector::const_iterator first, - std::vector::const_iterator last) - { - for(; first != last; ++first) - { - hash_combine(seed, *first); - } - } - template std::size_t hash_value(std::vector const& v) { diff --git a/include/boost/container_hash/hash.hpp b/include/boost/container_hash/hash.hpp index 76de793..7aac2fa 100644 --- a/include/boost/container_hash/hash.hpp +++ b/include/boost/container_hash/hash.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -118,7 +119,7 @@ namespace boost { namespace hash_detail { -#if defined(_HAS_AUTO_PTR_ETC) && !_HAS_AUTO_PTR_ETC +#if defined(BOOST_NO_CXX98_FUNCTION_BASE) template struct hash_base { @@ -426,7 +427,7 @@ namespace boost for(; first != last; ++first) { - hash_combine(seed, *first); + hash_combine::value_type>(seed, *first); } return seed; @@ -437,7 +438,7 @@ namespace boost { for(; first != last; ++first) { - hash_combine(seed, *first); + hash_combine::value_type>(seed, *first); } }