From 69114cabd7f04bcbd74fed362057e4c64e702795 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Fri, 9 Nov 2012 01:36:23 -0500 Subject: [PATCH] various bug fixes --- include/fc/json_rpc_connection.hpp | 4 ++-- include/fc/ptr.hpp | 2 +- include/fc/reflect.hpp | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/fc/json_rpc_connection.hpp b/include/fc/json_rpc_connection.hpp index 4bc6f4c..5a28956 100644 --- a/include/fc/json_rpc_connection.hpp +++ b/include/fc/json_rpc_connection.hpp @@ -50,14 +50,14 @@ namespace fc { namespace json { #define FC_JSON_NAMED_PARAMS( T ) \ namespace fc { namespace json {namespace detail { \ - template \ + template<> \ struct named_param< fc::tuple > { \ typedef fc::true_type type; \ static tuple cast( const value& v ) { return make_tuple(fc::value_cast(v)); } \ template \ static value to_value( X&& x ) { return value( x.a0 ); }\ }; \ - template \ + template<> \ struct named_param< fc::tuple > { \ typedef fc::true_type type; \ static tuple cast( const value& v ) { return make_tuple(fc::value_cast(v)); } \ diff --git a/include/fc/ptr.hpp b/include/fc/ptr.hpp index 3e5cb62..80ec4ab 100644 --- a/include/fc/ptr.hpp +++ b/include/fc/ptr.hpp @@ -96,7 +96,7 @@ namespace fc { #define FC_STUB( CLASS, METHODS ) \ namespace fc { namespace detail { \ template \ - struct vtable : public fc::retainable { \ + struct vtable : public fc::retainable { \ vtable(){} \ BOOST_PP_SEQ_FOR_EACH( FC_STUB_VTABLE_DEFINE_MEMBER, CLASS, METHODS ) \ template \ diff --git a/include/fc/reflect.hpp b/include/fc/reflect.hpp index 9833c4d..fcd5bdd 100644 --- a/include/fc/reflect.hpp +++ b/include/fc/reflect.hpp @@ -11,10 +11,12 @@ #include #include #include +#include #include #include #include +#include namespace fc { @@ -121,15 +123,15 @@ template<> struct reflector { \ switch( ENUM(i) ) { \ BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_ENUM_TO_STRING, v, FIELDS ) \ default: \ - FC_REFLECT_THROW( fc::reflect::unknown_field(), "%1% not in enum '%2%'", %i %BOOST_PP_STRINGIZE(ENUM) ); \ + FC_THROW_MSG( "Unknown field %s not in enum '%s'", i, BOOST_PP_STRINGIZE(ENUM) ); \ }\ } \ static ENUM from_string( const char* s ) { \ BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_ENUM_FROM_STRING, v, FIELDS ) \ - FC_REFLECT_THROW( fc::reflect::unknown_field(), "%1% in enum %2%", %s %BOOST_PP_STRINGIZE(ENUM) ); \ + FC_THROW_MSG( "Unknown field %s not in enum '%s'", s, BOOST_PP_STRINGIZE(ENUM) ); \ } \ }; \ -} } +}