Skip to content

Instantly share code, notes, and snippets.

@Amanieu
Created February 4, 2014 15:20
Show Gist options
  • Save Amanieu/8805643 to your computer and use it in GitHub Desktop.
Save Amanieu/8805643 to your computer and use it in GitHub Desktop.
diff --git a/src/common/IPC.h b/src/common/IPC.h
index cab883f..d1fcaee 100644
--- a/src/common/IPC.h
+++ b/src/common/IPC.h
@@ -209,7 +209,7 @@ template<> struct SerializeTraits<std::string> {
};
// IPC message, which automatically serializes and deserializes objects
-template<typename... T> class Message {
+template<uint32_t Major, uint32_t Minor, typename... T> class Message {
typedef std::tuple<T...> TupleType;
template<size_t Index, typename Tuple> static void FillTuple(Tuple&, Reader&) {}
@@ -240,6 +240,8 @@ public:
template<typename... Args> static void Serialize(Writer& stream, Args&&... args)
{
static_assert(sizeof...(Args) == sizeof...(T), "Incorrect number of arguments for IPC::Message::Serialize");
+ SerializeTraits<uint32_t>::Write(stream, Major);
+ SerializeTraits<uint32_t>::Write(stream, Minor);
SerializeImpl<0>(stream, std::forward<Args>(args)...);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment