Skip to content

Commit

Permalink
Make implicit the default constructors of siphash_32 and siphash_64
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 21, 2024
1 parent af1f91d commit da1d14e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions include/boost/hash2/siphash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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<std::uint32_t>( seed );
std::uint32_t k1 = static_cast<std::uint32_t>( seed >> 32 );
Expand Down

0 comments on commit da1d14e

Please sign in to comment.