zmqpp icon indicating copy to clipboard operation
zmqpp copied to clipboard

New Feature: zmqpp::message template

Open sunkin351 opened this issue 9 years ago • 3 comments

The goal of this is to allow interchangability of the base container of zmqpp::message. Currently, the only supported containers are std::vector (Its original) and std::deque.

P.S. Sorry for making message.hpp 700+ lines long (XD) and exposing the implementation. I couldn't find a way to keep the member functions out of the header. If someone could figure that out, I would love to hear it.

P.S.S. This is my first time creating templates on a large scale, I would not be surprised if I made a mistake or two, but I did test it on both ends of compilation, to make sure it worked as before. (Windows only)

Edit: It also didn't affect compile time as much as I was expecting.

sunkin351 avatar May 23 '16 04:05 sunkin351

This is in response to #162, I also forgot to mention that I added a clear() member function to the class, and that I did make sure I didn't break the current API or previous functionality by using typedef message_base<std::vector> message.

sunkin351 avatar May 23 '16 04:05 sunkin351

message_base would probably be better named like the std library way of doing templates with default behavior so basic_ which would make it basic_message which would become

typedef basic_message<std::vector> message;

Spartan322 avatar May 23 '16 04:05 Spartan322

This is giving me lots of errors locally, I will try and find time to check it and work through it but my free time for the next month is looking pretty bad sorry :(

benjamg avatar Jun 14 '16 16:06 benjamg