From 10b23b5b90197566c187c89a64ebfefa31115783 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 21 Jul 2018 17:23:35 -0400 Subject: ... --- include/salticidae/msg.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/salticidae/msg.h') diff --git a/include/salticidae/msg.h b/include/salticidae/msg.h index 8a63a50..3a1eebf 100644 --- a/include/salticidae/msg.h +++ b/include/salticidae/msg.h @@ -56,6 +56,15 @@ class MsgBase { public: MsgBase(): magic(0x0), no_payload(true) {} + template::value && + !std::is_same::value>::type> + MsgBase(const MsgType &msg): magic(0x0) { + set_opcode(MsgType::opcode); + set_payload(std::move(msg.serialized)); + } + MsgBase(const MsgBase &other): magic(other.magic), opcode(other.opcode), -- cgit v1.2.3