11
11
#include " util.h"
12
12
#include " util/reverse_iterator.h"
13
13
14
- #include < boost/variant/apply_visitor.hpp>
15
14
#include < openssl/md5.h>
16
15
17
16
using namespace GRC ;
@@ -475,7 +474,7 @@ class LegacySuperblockParser
475
474
// !
476
475
// ! \brief Gets the string representation of a quorum hash object.
477
476
// !
478
- struct QuorumHashToStringVisitor : boost::static_visitor<std::string>
477
+ struct QuorumHashToStringVisitor
479
478
{
480
479
// !
481
480
// ! \brief Get the string representation of an invalid or empty quorum hash.
@@ -1016,7 +1015,7 @@ QuorumHash::QuorumHash(const std::vector<unsigned char>& bytes) : QuorumHash()
1016
1015
m_hash = uint256 (bytes);
1017
1016
} else if (bytes.size () == sizeof (Md5Sum)) {
1018
1017
m_hash = Md5Sum ();
1019
- std::copy (bytes.begin (), bytes.end (), boost ::get<Md5Sum>(m_hash).begin ());
1018
+ std::copy (bytes.begin (), bytes.end (), std ::get<Md5Sum>(m_hash).begin ());
1020
1019
}
1021
1020
}
1022
1021
@@ -1081,7 +1080,7 @@ QuorumHash QuorumHash::Parse(const std::string& hex)
1081
1080
1082
1081
bool QuorumHash::operator ==(const QuorumHash& other) const
1083
1082
{
1084
- if (m_hash.which () != other.m_hash .which ()) {
1083
+ if (m_hash.index () != other.m_hash .index ()) {
1085
1084
return false ;
1086
1085
}
1087
1086
@@ -1090,12 +1089,12 @@ bool QuorumHash::operator==(const QuorumHash& other) const
1090
1089
return true ;
1091
1090
1092
1091
case Kind::SHA256:
1093
- return boost ::get<uint256>(m_hash)
1094
- == boost ::get<uint256>(other.m_hash );
1092
+ return std ::get<uint256>(m_hash)
1093
+ == std ::get<uint256>(other.m_hash );
1095
1094
1096
1095
case Kind::MD5:
1097
- return boost ::get<Md5Sum>(m_hash)
1098
- == boost ::get<Md5Sum>(other.m_hash );
1096
+ return std ::get<Md5Sum>(m_hash)
1097
+ == std ::get<Md5Sum>(other.m_hash );
1099
1098
}
1100
1099
1101
1100
return false ;
@@ -1109,7 +1108,7 @@ bool QuorumHash::operator!=(const QuorumHash& other) const
1109
1108
bool QuorumHash::operator ==(const uint256& other) const
1110
1109
{
1111
1110
return Which () == Kind::SHA256
1112
- && boost ::get<uint256>(m_hash) == other;
1111
+ && std ::get<uint256>(m_hash) == other;
1113
1112
}
1114
1113
1115
1114
bool QuorumHash::operator !=(const uint256& other) const
@@ -1125,13 +1124,13 @@ bool QuorumHash::operator==(const std::string& other) const
1125
1124
1126
1125
case Kind::SHA256:
1127
1126
return other.size () == sizeof (uint256) * 2
1128
- && boost ::get<uint256>(m_hash) == uint256S (other);
1127
+ && std ::get<uint256>(m_hash) == uint256S (other);
1129
1128
1130
1129
case Kind::MD5:
1131
1130
return other.size () == sizeof (Md5Sum) * 2
1132
1131
&& std::equal (
1133
- boost ::get<Md5Sum>(m_hash).begin (),
1134
- boost ::get<Md5Sum>(m_hash).end (),
1132
+ std ::get<Md5Sum>(m_hash).begin (),
1133
+ std ::get<Md5Sum>(m_hash).end (),
1135
1134
ParseHex (other).begin ());
1136
1135
}
1137
1136
@@ -1145,7 +1144,7 @@ bool QuorumHash::operator!=(const std::string&other) const
1145
1144
1146
1145
QuorumHash::Kind QuorumHash::Which () const
1147
1146
{
1148
- return static_cast <Kind>(m_hash.which ());
1147
+ return static_cast <Kind>(m_hash.index ());
1149
1148
}
1150
1149
1151
1150
bool QuorumHash::Valid () const
@@ -1159,15 +1158,15 @@ const unsigned char* QuorumHash::Raw() const
1159
1158
case Kind::INVALID:
1160
1159
return nullptr ;
1161
1160
case Kind::SHA256:
1162
- return boost ::get<uint256>(m_hash).begin ();
1161
+ return std ::get<uint256>(m_hash).begin ();
1163
1162
case Kind::MD5:
1164
- return boost ::get<Md5Sum>(m_hash).data ();
1163
+ return std ::get<Md5Sum>(m_hash).data ();
1165
1164
}
1166
1165
1167
1166
return nullptr ;
1168
1167
}
1169
1168
1170
1169
std::string QuorumHash::ToString () const
1171
1170
{
1172
- return boost::apply_visitor (QuorumHashToStringVisitor (), m_hash);
1171
+ return std::visit (QuorumHashToStringVisitor (), m_hash);
1173
1172
}
0 commit comments