mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
lang/c/msgpack: C++ binding: reexamined global operators
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@72 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
parent
f4a6d7faa1
commit
2c7f0b2b1a
10 changed files with 241 additions and 209 deletions
|
|
@ -25,7 +25,7 @@ namespace msgpack {
|
|||
namespace type {
|
||||
|
||||
|
||||
inline bool& operator<< (bool& v, object o)
|
||||
inline bool& operator>> (object o, bool& v)
|
||||
{
|
||||
if(o.type != BOOLEAN) { throw type_error(); }
|
||||
v = o.via.boolean;
|
||||
|
|
@ -34,11 +34,11 @@ inline bool& operator<< (bool& v, object o)
|
|||
|
||||
|
||||
template <typename Stream>
|
||||
inline const bool& operator>> (const bool& v, packer<Stream> o)
|
||||
inline packer<Stream>& operator<< (packer<Stream>& o, const bool& v)
|
||||
{
|
||||
if(v) { o.pack_true(); }
|
||||
else { o.pack_false(); }
|
||||
return v;
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue