mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-13 10:52:57 +01:00
fixed peektyp check and return value
This commit is contained in:
parent
d9f0f016c0
commit
e6dd71e544
@ -341,9 +341,10 @@ public:
|
||||
T peektyp(size_t index)
|
||||
{
|
||||
static_assert(!std::is_same<T, std::string>::value, "Use peekstr() instead of peektyp<std::string>()");
|
||||
if(sizeof(T) != m_parts.front().size())
|
||||
if(sizeof(T) != m_parts[index].size())
|
||||
throw std::runtime_error("Invalid type, size does not match the message size");
|
||||
T type = *m_parts[index].data<T>();
|
||||
return type;
|
||||
}
|
||||
|
||||
// Create multipart from type (fixed-size)
|
||||
|
Loading…
Reference in New Issue
Block a user