Skip to content

Commit

Permalink
Work around GCC 11 and earlier inability to handle default template a…
Browse files Browse the repository at this point in the history
…rguments correctly
  • Loading branch information
pdimov committed Oct 24, 2024
1 parent 2f18874 commit 6e20fb9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/boost/hash2/hash_append_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,36 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt

#include <boost/config.hpp>

namespace boost
{
namespace hash2
{

#if defined(BOOST_GCC) && BOOST_GCC < 120000

// Due to a bug in GCC 11 and earlier, the default argument
// for Flavor needs to be present on the first declaration

struct default_flavor;

template<class Hash, class Flavor = default_flavor, class T> void hash_append( Hash& h, Flavor const& f, T const& v );
template<class Hash, class Flavor = default_flavor, class It> void hash_append_range( Hash& h, Flavor const& f, It first, It last );
template<class Hash, class Flavor = default_flavor, class T> void hash_append_size( Hash& h, Flavor const& f, T const& v );
template<class Hash, class Flavor = default_flavor, class It> void hash_append_sized_range( Hash& h, Flavor const& f, It first, It last );
template<class Hash, class Flavor = default_flavor, class It> void hash_append_unordered_range( Hash& h, Flavor const& f, It first, It last );

#else

template<class Hash, class Flavor, class T> void hash_append( Hash& h, Flavor const& f, T const& v );
template<class Hash, class Flavor, class It> void hash_append_range( Hash& h, Flavor const& f, It first, It last );
template<class Hash, class Flavor, class T> void hash_append_size( Hash& h, Flavor const& f, T const& v );
template<class Hash, class Flavor, class It> void hash_append_sized_range( Hash& h, Flavor const& f, It first, It last );
template<class Hash, class Flavor, class It> void hash_append_unordered_range( Hash& h, Flavor const& f, It first, It last );

#endif

} // namespace hash2
} // namespace boost

Expand Down

0 comments on commit 6e20fb9

Please sign in to comment.