Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boost header include for specializing boost::hash #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

b1aafulei
Copy link

@b1aafulei b1aafulei commented Sep 1, 2021

In include/fc/crypto/sha256.hpp we specialized boost::hash<> without properly including the Boost header <boost/container_hash/hash.hpp>.

namespace boost
{
template<>
struct hash<fc::sha256>
{
size_t operator()( const fc::sha256& s )const

This PR includes the above header.

The previous success of the fc build might have relied on some cross-inclusion among the Boost headers. However, while this is still okay with Boost 1.76, the fc library build starts to fail with the latest Boost 1.77 version (built on a Ubuntu 18.04 machine with g++-8) reporting the following errors:

.../external/fc/include/fc/crypto/sha256.hpp:127:12: error: ‘hash’ is not a class template
     struct hash<fc::sha256>
            ^~~~
.../external/fc/include/fc/crypto/sha256.hpp:128:5: error: explicit specialization of non-template ‘boost::hash’
     {
     ^

Considering that the current EOSIO software mostly depends on Boost 1.72, it is still okay for the fc library for the time being. But the problem might surface if we will upgrade to 1.77 or later.

Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should target eosio

@heifner heifner changed the base branch from master to eosio October 27, 2021 00:24
@heifner heifner changed the base branch from eosio to eosio-2.0.x October 27, 2021 00:24
@heifner heifner changed the base branch from eosio-2.0.x to master October 27, 2021 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants