Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[istream.manip] and [ostream.manip] say "namespace std { }" unnecessarily #416

Closed
StephanTLavavej opened this issue Dec 3, 2014 · 0 comments · Fixed by #421
Closed

[istream.manip] and [ostream.manip] say "namespace std { }" unnecessarily #416

StephanTLavavej opened this issue Dec 3, 2014 · 0 comments · Fixed by #421

Comments

@StephanTLavavej
Copy link
Contributor

N4296 27.7.2.4 [istream.manip] says:

namespace std {
  template <class charT, class traits>
    basic_istream<charT,traits>& ws(basic_istream<charT,traits>& is);
}

This isn't a synopsis. It's a "definition", where the Standard conventionally doesn't depict the namespace.

27.7.3.8 [ostream.manip] is similarly affected.

k-satoda added a commit to k-satoda/cplusplus-draft that referenced this issue Mar 30, 2016
The note implies that the types of constant macros defined in <climits>
may differ from that of C, but no nomative rule say so, and there is no
reason to allow such incompatibilities.

The note was added as the resolution of LWG issue cplusplus#416.
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#416
But the analysis, which based on rules of integer constants, was wrong:
The type of constant macros are defined in C99 (5.2.4.2.1 p1) by rules
of integer promotions. So LONG_MAX always has type long (integer
promotions has no effect for long), even if the actual range of long and
int are equal. That should hold in C++, too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant