forked from cheng/wallet
putting in additional SFINAE guards in an effort to hunt down pesky and mysterious warnings
This commit is contained in:
parent
9a12dbbd7e
commit
1b0d5148e8
@ -448,7 +448,10 @@ namespace ristretto255 {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ristretto255::hsh<hashsize>& operator << (const T& j) {
|
||||
typename std::enable_if<
|
||||
ro::is_serializable<const T>::value,
|
||||
ristretto255::hsh<hashsize>&
|
||||
>::type operator << (const T& j) {
|
||||
int i{ 1 };
|
||||
if constexpr (std::is_same_v<std::remove_cvref_t<T>, std::span<const byte> >) {
|
||||
i = crypto_generichash_blake2b_update(
|
||||
@ -464,7 +467,8 @@ namespace ristretto255 {
|
||||
strlen(j) + 1
|
||||
);
|
||||
}
|
||||
else if constexpr (is_serializable<const T>::value) {
|
||||
else {
|
||||
static_assert(is_serializable<const T>::value, "don't know a machine and compiler independent representation of this type");
|
||||
auto sj = ro::serialize(j);
|
||||
i = crypto_generichash_blake2b_update(
|
||||
&(this->st),
|
||||
@ -472,9 +476,6 @@ namespace ristretto255 {
|
||||
sj.size()
|
||||
);
|
||||
}
|
||||
else {
|
||||
static_assert(false, "don't know a machine and compiler independent representation of this type");
|
||||
}
|
||||
if (i) throw HashReuseException();
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user