[ 
https://issues.apache.org/jira/browse/STDCXX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519361
 ] 

Martin Sebor commented on STDCXX-519:
-------------------------------------

You're right, we should try to avoid polluting the examples with kludges for 
broken compilers. If there's a way to cleanly work around the compiler bug by 
rewriting the code using some intuitive syntax that should be an acceptable 
solution.

As for (2), IMO, neither of the two solutions would be ideal but I would 
consider std::ios_base::fmtflags(-1) a cleaner workaround than 
std::ios_base::fmtflags(0) because there's no simpler way to write the former 
while there is a simple way to write the latter: std::ios_base::fmtflags(), or 
in a ctor initializer list, simply "()."

Regarding (3), if the typedef helps, it would be my preference. Typedefs are 
often introduced for complicated/complex types for convenience. I suppose 
std::ios_base::fmtflags could be considered such a "complicated" type if the 
convenience typedef makes the code easier to read. For example, typedef 
std::ios_base::fmtflags fmtflags would be a good choice (IMO).

It's your call :)

> [MSVC 7.1 fails to compile fmtflags_manip.cpp example
> -----------------------------------------------------
>
>                 Key: STDCXX-519
>                 URL: https://issues.apache.org/jira/browse/STDCXX-519
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Examples
>         Environment: MSVC 7.1
>            Reporter: Farid Zaripov
>            Priority: Minor
>
> The compiler issues the errors:
> --------------
> Compiling...
> fmtflags_manip.cpp
> \stdcxx\trunk\examples\manual\fmtflags_manip.cpp(45) : error C2065: 
> '__rw_fmtflags' : undeclared identifier
> \stdcxx\trunk\examples\manual\fmtflags_manip.cpp(45) : error C2064: term does 
> not evaluate to a function taking 0 arguments
> --------------
> Created corresponding issue on Microsoft feedback page:
> https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=267488

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to