mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
cpp: alias pack(Stream* s, const T& v) -> pack(Stream& const T& v)
This commit is contained in:
parent
1b1433a664
commit
72e3f98213
3 changed files with 18 additions and 7 deletions
|
|
@ -28,6 +28,7 @@ namespace msgpack {
|
|||
template <typename Stream>
|
||||
class packer {
|
||||
public:
|
||||
packer(Stream* s);
|
||||
packer(Stream& s);
|
||||
~packer();
|
||||
|
||||
|
|
@ -111,6 +112,12 @@ private:
|
|||
};
|
||||
|
||||
|
||||
template <typename Stream, typename T>
|
||||
inline void pack(Stream* s, const T& v)
|
||||
{
|
||||
packer<Stream>(s).pack(v);
|
||||
}
|
||||
|
||||
template <typename Stream, typename T>
|
||||
inline void pack(Stream& s, const T& v)
|
||||
{
|
||||
|
|
@ -133,6 +140,9 @@ inline void pack(Stream& s, const T& v)
|
|||
#include "msgpack/pack_template.h"
|
||||
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>::packer(Stream* s) : m_stream(*s) { }
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>::packer(Stream& s) : m_stream(s) { }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue