aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/deps/rpclib/include/rpc/detail/util.h
blob: 302cb93b7dcfbe4c5de845fb8ee4a902b2b87bfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#ifndef UTIL_H_YRIZ63UJ
#define UTIL_H_YRIZ63UJ

#include "rpc/msgpack.hpp"
#include "rpc/detail/make_unique.h"

namespace rpc {
namespace detail {
template <typename T> RPCLIB_MSGPACK::object_handle pack(T &&o) {
    auto z = rpc::detail::make_unique<RPCLIB_MSGPACK::zone>();
    RPCLIB_MSGPACK::object obj(std::forward<T>(o), *z);
    return RPCLIB_MSGPACK::object_handle(obj, std::move(z));
}
} /* detail */
} /* rpc  */

#endif /* end of include guard: UTIL_H_YRIZ63UJ */