Skip to content
Permalink
Browse files

Fix ArgBuffer String Serialization (#999)

  • Loading branch information...
Headline committed May 4, 2019
1 parent e1648ba commit 9cd2a742710280b01443023b393fa21fd7681e08
Showing with 3 additions and 3 deletions.
  1. +3 −3 public/sm_argbuffer.h
@@ -37,7 +37,7 @@
template <typename T, typename...Rest>
class ArgBuffer {
public:
ArgBuffer(T t, Rest... rest) {
ArgBuffer(const T& t, const Rest&... rest) {
unsigned char *ptr = buff;
buildbuffer(&ptr, t, rest...);
}
@@ -60,13 +60,13 @@ class ArgBuffer {
}

template <typename K>
void buildbuffer(unsigned char **ptr, K k) {
void buildbuffer(unsigned char **ptr, K& k) {
memcpy(*ptr, &k, sizeof(k));
*ptr += sizeof(K);
}

template <typename K, typename... Kn>
void buildbuffer(unsigned char **ptr, K k, Kn... kn) {
void buildbuffer(unsigned char **ptr, K& k, Kn&... kn) {
buildbuffer(ptr, k);
if (sizeof...(kn)!=0)
buildbuffer(ptr, kn...);

0 comments on commit 9cd2a74

Please sign in to comment.
You can’t perform that action at this time.