Created on 2010-08-25.00:00:00 last changed 164 months ago
Proposed resolution:
Add a new entry in Table 14 — C++ library headers:
Table 14 — C++ library headers … <iterator> <library_support> <limits> …
Remove the last row [thread.threads] <threads> from Table 16 — C++ headers for freestanding implementations and insert a new one instead (To the editor: For the actual target Clause please see the comment in bullet 5 of this proposed resolution):
Table 16 — C++ headers for freestanding implementations Subclause Header(s) … [thread.threads] Threads<thread>?? Library support <library_support>
Modify paragraph [compliance] p. 3:
3 The supplied version of the header <cstdlib> shall declare at least the functions abort, atexit, at_quick_exit, exit, and quick_exit (18.5).
The supplied version of the header <thread> shall meet the same requirements as for a hosted implementation or including it shall have no effect. The other headers listed in this table shall meet the same requirements as for a hosted implementation. A program can detect the presence of standard headers not listed in Table 16 using the facilities provided by the <library_support> header.
Remove the following line from the header <thread> synopsis in [thread.threads] p. 1:
namespace std {#define __STDCPP_THREADS__ __cplusplusclass thread; [...] }
Add a new section in Clause 18 or 20 (or any other suitable place at the editor's discretion):
?? Library support [library.support]
The header <library_support> defines an implementation-defined set of macros to allow a program detect the presence of standard headers in freestanding implementations. [Note: Hosted implementations shall provide all standard headers, thus shall provide all macros. — end note]
For each standard header listed in Tables 14 (C++ library headers) and 15 (C++ headers for C library facilities) that is provided by the implementation, <library_support> shall define a macro with name
_ _HAS_XXX_HEADER_ _
whereXXX
is replaced by the uppercase version of the name of the header. Each such macro shall expand to the value_ _cplusplus
. [Example:#include <library_support> #ifdef _ _HAS_THREADS_HEADER_ _ #include <threads> // code that exploit the presence of threads #else // fallback code that doesn't rely on threads #endif— end example]
No other standard header shall define macros with a name beginning with
_ _HAS_
and ending with_HEADER_ _
.
Rationale:
We are not adding new headers to freestanding at this point.
[ 2011-03-24 Madrid meeting ]
Freestanding no longer requires <thread> header
[ 2011-03-06: Daniel observes: ]
Accepting the proposal n3256 would solve this issue.
[ 2011-02-25: Alberto drafts wording ]
[ Original resolution proposed by NB comment: ]
Add the <chrono> and <ratio> headers to the freestanding requirements.
It might be necessary to address scaled-down expectations of clock support in a freestanding environment, much like <thread>.
[ Extracts from lengthy Rapperswil discussion: ]
There is a concern that this issue is a misunderstanding of the actual requirements of a free-standing implementation to support the <thread> header. In general, a free-standanding implementation will provide an empty header, specifically so that a user can test for the absence of the _ _ STDCPP_THREADS _ _ macro. This idiom as used as there is no portable way to test for the lack of a header.
At this point, it was suggested the NB comment is trying to solve the wrong problem, and that _ _ STDCPP_THREADS _ _ should be a pre-defined macro in clause 16 that can be tested before including <thread>. That would remove the need to add additional headers to the free-standanding requirements.
It is worth noting that Japan requested <ratio> as a free-standing header in their CD1 comments. No-one seemed keen to require clocks of a free-standing implementation though.
Detlef volunteers to look at a way to redraft 17.6.1.3 p3.
Addresses GB-55
The <thread> header uses duration types, found in the <chrono> header, and which rely on the ratio types declared in the <ratio> header.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-06-02 15:28:39 | admin | set | messages: + msg5803 |
2011-03-24 15:58:06 | admin | set | messages: + msg5679 |
2011-03-24 15:58:06 | admin | set | status: open -> nad |
2011-03-06 19:27:01 | admin | set | messages: + msg5624 |
2011-02-25 00:14:19 | admin | set | messages: + msg5544 |
2011-02-25 00:14:19 | admin | set | messages: + msg5543 |
2010-10-24 22:33:31 | admin | set | messages: + msg5065 |
2010-10-24 22:33:31 | admin | set | messages: + msg5064 |
2010-10-24 10:50:39 | admin | set | messages: + msg4988 |
2010-08-25 00:00:00 | admin | create |