From 3483416e5a3e4137d481977763c40915dc7e6b06 Mon Sep 17 00:00:00 2001 From: laplaceyang Date: Thu, 8 Dec 2016 20:46:52 +0800 Subject: [PATCH] addd operator[] and at function --- zmq_addon.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/zmq_addon.hpp b/zmq_addon.hpp index 43c7d3b..33b0683 100644 --- a/zmq_addon.hpp +++ b/zmq_addon.hpp @@ -93,6 +93,26 @@ public: clear(); } + message_t& operator[] (size_t n) + { + return m_parts[n]; + } + + const message_t& operator[] (size_t n) const + { + return m_parts[n]; + } + + message_t& at (size_t n) + { + return m_parts.at(n); + } + + const message_t& at (size_t n) const + { + return m_parts.at(n); + } + // Delete all parts void clear() {