summaryrefslogtreecommitdiff
path: root/cpp/msgpack
diff options
context:
space:
mode:
authorfrsyuki <frsyuki@users.sourceforge.jp>2010-03-26 14:30:50 +0900
committerfrsyuki <frsyuki@users.sourceforge.jp>2010-03-26 14:30:50 +0900
commit72e3f9821300f53d988e546a8dc7e001d9acb717 (patch)
tree5d53619a37c024741b68401d8643318544e13975 /cpp/msgpack
parent1b1433a6642036d51e49e35b64b3534a38d95916 (diff)
downloadmsgpack-python-72e3f9821300f53d988e546a8dc7e001d9acb717.tar.gz
cpp: alias pack(Stream* s, const T& v) -> pack(Stream& const T& v)
Diffstat (limited to 'cpp/msgpack')
-rw-r--r--cpp/msgpack/pack.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/msgpack/pack.hpp b/cpp/msgpack/pack.hpp
index 9c291c1..b7b3ca1 100644
--- a/cpp/msgpack/pack.hpp
+++ b/cpp/msgpack/pack.hpp
@@ -28,6 +28,7 @@ namespace msgpack {
template <typename Stream>
class packer {
public:
+ packer(Stream* s);
packer(Stream& s);
~packer();
@@ -112,6 +113,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)
{
packer<Stream>(s).pack(v);
@@ -134,6 +141,9 @@ inline void pack(Stream& s, const T& v)
template <typename Stream>
+packer<Stream>::packer(Stream* s) : m_stream(*s) { }
+
+template <typename Stream>
packer<Stream>::packer(Stream& s) : m_stream(s) { }
template <typename Stream>