From 22fd249b129d267c863fa7eedc0bf297894129cb Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Wed, 13 Jan 2016 15:31:36 +0900 Subject: [PATCH] Fixed #392 Avoided the warning when `char` does not have sign using template lazy instantiation. Removed redundant `inline`. --- include/msgpack/adaptor/int.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/msgpack/adaptor/int.hpp b/include/msgpack/adaptor/int.hpp index c8f471c4f..32f73ec3c 100644 --- a/include/msgpack/adaptor/int.hpp +++ b/include/msgpack/adaptor/int.hpp @@ -27,7 +27,7 @@ namespace detail { template struct convert_integer_sign { - static inline T convert(msgpack::object const& o) { + static T convert(msgpack::object const& o) { if(o.type == msgpack::type::POSITIVE_INTEGER) { if(o.via.u64 > static_cast(std::numeric_limits::max())) { throw msgpack::type_error(); } @@ -43,7 +43,7 @@ namespace detail { template struct convert_integer_sign { - static inline T convert(msgpack::object const& o) { + static T convert(msgpack::object const& o) { if(o.type == msgpack::type::POSITIVE_INTEGER) { if(o.via.u64 > static_cast(std::numeric_limits::max())) { throw msgpack::type_error(); } @@ -69,7 +69,9 @@ namespace detail { template <> struct object_char_sign { - static inline void make(msgpack::object& o, char v) { + template + static typename msgpack::enable_if::value>::type + make(msgpack::object& o, T v) { if (v < 0) { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = v; @@ -83,7 +85,7 @@ namespace detail { template <> struct object_char_sign { - static inline void make(msgpack::object& o, char v) { + static void make(msgpack::object& o, char v) { o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; } };