Browse Source

Revert use of operator T(), etc and remove conflicting cast operator to unsigned from RLP.

unsigned is size_t on 32 bit builds, and the compiler therefore thinks conversion from RLP to vector<T> is ambiguous between:
RLP::operator vector<T>() const
and
vector<T>::vector<T>(size_t size)
cl-refactor
Tim Hughes 11 years ago
parent
commit
682603f834
  1. 1
      libdevcore/RLP.h
  2. 2
      libwhisper/WhisperPeer.h

1
libdevcore/RLP.h

@ -160,7 +160,6 @@ public:
explicit operator std::string() const { return toString(); }
explicit operator RLPs() const { return toList(); }
explicit operator byte() const { return toInt<byte>(); }
explicit operator unsigned() const { return toInt<unsigned>(); }
explicit operator u256() const { return toInt<u256>(); }
explicit operator bigint() const { return toInt<bigint>(); }
template <unsigned _N> explicit operator FixedHash<_N>() const { return toHash<FixedHash<_N>>(); }

2
libwhisper/WhisperPeer.h

@ -95,7 +95,7 @@ class MessageFilter
public:
MessageFilter() {}
MessageFilter(std::vector<std::pair<bytes, bytes> > const& _m): m_topicMasks(_m) {}
MessageFilter(RLP const& _r): m_topicMasks(_r.operator std::vector<std::pair<bytes, bytes>>()) {}
MessageFilter(RLP const& _r): m_topicMasks((std::vector<std::pair<bytes, bytes>>)_r) {}
void fillStream(RLPStream& _s) const { _s << m_topicMasks; }
h256 sha3() const { RLPStream s; fillStream(s); return dev::eth::sha3(s.out()); }

Loading…
Cancel
Save