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.
    }
This commit is contained in:
Kohei Takahashi
2014-11-24 03:07:16 +09:00
parent 4dd4773d3d
commit 687668c110

View File

@ -235,14 +235,16 @@ namespace boost { namespace fusion
template <typename Stream, typename Char, typename Traits> \
Stream& operator>>(Stream& s, const name##_type<Char,Traits>& m) \
{ \
string_ios_manip<name##_tag, Stream>(s).set(m.data); \
string_ios_manip<name##_tag, Stream> manip(s); \
manip.set(m.data); \
return s; \
} \
\
template <typename Stream, typename Char, typename Traits> \
Stream& operator<<(Stream& s, const name##_type<Char,Traits>& m) \
{ \
string_ios_manip<name##_tag, Stream>(s).set(m.data); \
string_ios_manip<name##_tag, Stream> manip(s); \
manip.set(m.data); \
return s; \
} \
} \