From 2977ca954f0040d3157831615ce0b23e0a3ec9ce Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Tue, 17 Mar 2015 16:24:39 -0400 Subject: [PATCH] Workaround compile errors on MSVC --- include/fc/api.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/fc/api.hpp b/include/fc/api.hpp index 5ef581b..cf42287 100644 --- a/include/fc/api.hpp +++ b/include/fc/api.hpp @@ -4,6 +4,14 @@ #include #include +// ms visual c++ (as of 2013) doesn't accept the standard syntax for calling a +// templated member function (foo->template bar();) +#ifdef _MSC_VER +# define FC_CALL_MEMBER_TEMPLATE_KEYWORD +#else +# define FC_CALL_MEMBER_TEMPLATE_KEYWORD template +#endif + namespace fc { struct identity_member { template @@ -46,7 +54,7 @@ namespace fc { T& ptr = boost::any_cast(*_data); auto& pointed_at = *ptr; typedef typename std::remove_reference::type source_vtable_type; - _vtable->template visit_other( vtable_copy_visitor(pointed_at) ); + _vtable->FC_CALL_MEMBER_TEMPLATE_KEYWORD visit_other( vtable_copy_visitor(pointed_at) ); } api( const api& cpy ):_vtable(cpy._vtable),_data(cpy._data) {}