From 687668c11024976877fc798f446533266c8e9d3b Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Mon, 24 Nov 2014 03:07:16 +0900 Subject: [PATCH] Fix sprious compile error on VS2015 Preview. MSVC 2015 Preview will treat unary-ctor call as a variable declaration even if member call follows, which member has the same name with any other class (i.e. there are no relations between the member and such class). This issue already reported at [1]. 1. https://connect.microsoft.com/VisualStudio/feedback/details/1037783/unary-ctor-call-v-s-variable-decl struct foo { foo(int) {} void set() {} }; struct set; int main() { int i; foo(i).set(); // VS2015 try to decl `i` here and conflict with above. } --- include/boost/fusion/sequence/io/detail/manip.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/sequence/io/detail/manip.hpp b/include/boost/fusion/sequence/io/detail/manip.hpp index 8d8c296d..ec8ce304 100644 --- a/include/boost/fusion/sequence/io/detail/manip.hpp +++ b/include/boost/fusion/sequence/io/detail/manip.hpp @@ -235,14 +235,16 @@ namespace boost { namespace fusion template \ Stream& operator>>(Stream& s, const name##_type& m) \ { \ - string_ios_manip(s).set(m.data); \ + string_ios_manip manip(s); \ + manip.set(m.data); \ return s; \ } \ \ template \ Stream& operator<<(Stream& s, const name##_type& m) \ { \ - string_ios_manip(s).set(m.data); \ + string_ios_manip manip(s); \ + manip.set(m.data); \ return s; \ } \ } \