From da1d14e49180af9af2d7f6488ddb8dfc3b5d6c13 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 21 Oct 2024 16:18:29 +0300 Subject: [PATCH] Make implicit the default constructors of siphash_32 and siphash_64 --- include/boost/hash2/siphash.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/boost/hash2/siphash.hpp b/include/boost/hash2/siphash.hpp index f453184..90cf2f8 100644 --- a/include/boost/hash2/siphash.hpp +++ b/include/boost/hash2/siphash.hpp @@ -80,7 +80,12 @@ class siphash_64 typedef std::uint64_t result_type; typedef std::uint64_t size_type; - explicit siphash_64( std::uint64_t k0 = 0, std::uint64_t k1 = 0 ): m_( 0 ), n_( 0 ) + siphash_64(): m_( 0 ), n_( 0 ) + { + init( 0, 0 ); + } + + explicit siphash_64( std::uint64_t k0, std::uint64_t k1 = 0 ): m_( 0 ), n_( 0 ) { init( k0, k1 ); } @@ -262,7 +267,12 @@ class siphash_32 typedef std::uint32_t result_type; typedef std::uint32_t size_type; - explicit siphash_32( std::uint64_t seed = 0 ): m_( 0 ), n_( 0 ) + siphash_32(): m_( 0 ), n_( 0 ) + { + init( 0, 0 ); + } + + explicit siphash_32( std::uint64_t seed ): m_( 0 ), n_( 0 ) { std::uint32_t k0 = static_cast( seed ); std::uint32_t k1 = static_cast( seed >> 32 );