Revised 2019-08-05 at 16:08:15 UTC
Section: 17.12 [support.runtime] Status: Tentatively Resolved Submitter: Thomas Plum Opened: 2012-04-30 Last modified: 2019-03-26
Priority: 4
View all other issues in [support.runtime].
View all issues with Tentatively Resolved status.
Discussion:
Since C99, the C standard describes a macro named __bool_true_false_are_defined.
In the process of harmonizing C++11 with C99, this name became part of the C++ standard. I propose that all mention of this name should be removed from the C and C++ standards. Here's the problem: The name was originally proposed as a transition tool, so that the headers for a project could contain lines like the following.#if !defined(__bool_true_false_are_defined) #define bool int /* or whatever */ #define true 1 #define false 0 #endif
Then when the project was compiled by a "new" compiler that implemented bool as defined by the evolving C++98 or C99 standards, those lines would be skipped; but when compiled by an "old" compiler that didn't yet provide bool, true, and false, then the #define's would provide a simulation that worked for most purposes.
It turns out that there is an unfortunate ambiguity in the name. One interpretation is as shown above, but a different reading says "bool, true, and false are #define'd", i.e. that the meaning of the macro is to assert that these names are macros (not built-in) ... which is true in C, but not in C++. In C++11, the name appears in parentheses followed by a stray period, so some editorial change is needed in any event: 17.12 [support.runtime] para 1:Headers <csetjmp> (nonlocal jumps), <csignal> (signal handling), <cstdalign> (alignment), <cstdarg> (variable arguments), <cstdbool> (__bool_true_false_are_defined). <cstdlib> (runtime environment getenv(), system()), and <ctime> (system clock clock(), time()) provide further compatibility with C code.
However, para 2 says
"The contents of these headers are the same as the Standard C library headers <setjmp.h>, <signal.h>, <stdalign.h>, <stdarg.h>, <stdbool.h>, <stdlib.h>, and <time.h>, respectively, with the following changes:",
and para 8 says
"The header <cstdbool> and the header <stdbool.h> shall not define macros named bool, true, or false."
Thus para 8 doesn't exempt the C++ implementation from the arguably clear requirement of the C standard, to provide a macro named __bool_true_false_are_defined defined to be 1.
Real implementations of the C++ library differ, so the user cannot count upon any consistency; furthermore, the usefulness of the transition tool has faded long ago. That's why my suggestion is that both C and C++ standards should eliminate any mention of __bool_true_false_are_defined. In that case, the name belongs to implementers to provide, or not, as they choose.[2013-03-15 Issues Teleconference]
Moved to Open.
While not strictly necessary, the clean-up look good.
We would like to hear from our C liaison before moving on this issue though.
[2015-05 Lenexa]
LWG agrees. Jonathan provides wording.
[2017-03-04, Kona]
The reference to <cstdbool> in p2 needs to be struck as well. Continue the discussion on the reflector once the DIS is available.
Previous resolution [SUPERSEDED]:
This wording is relative to N4296.
Edit the footnote on 16.5.1.2 [headers] p7:
176) In particular, including any of the standard headers <stdbool.h>, <cstdbool>, <iso646.h> or <ciso646> has no effect.
Edit 17.12 [support.runtime] p1 as indicated (and remove the index entry for __bool_true_false_are_defined):
-1- Headers <csetjmp> (nonlocal jumps), <csignal> (signal handling), <cstdalign> (alignment), <cstdarg> (variable arguments), <cstdbool>,
(__bool_true_false_are_defined).<cstdlib> (runtime environment getenv(), system()), and <ctime> (system clock clock(), time()) provide further compatibility with C code.Remove Table 38 — Header <cstdbool> synopsis [tab:support.hdr.cstdbool] from 17.12 [support.runtime]
Table 38 — Header <cstdbool> synopsis Type Name(s) Macro: __bool_true_false_are_defined
[2019-03-18; Daniel comments and eliminates previously proposed wording]
With the approval of P0619R4 in Rapperswil, the offending wording has now been eliminated from the working draft. I suggest to close this issue as: Resolved by P0619R4.
Rationale:
Resolved by P0619R4.Proposed resolution:
Section: 16.4.1.4 [structure.specifications] Status: Tentatively Resolved Submitter: Jeffrey Yasskin Opened: 2013-09-03 Last modified: 2019-03-26
Priority: 3
View other active issues in [structure.specifications].
View all other issues in [structure.specifications].
View all issues with Tentatively Resolved status.
Discussion:
The C++14 CD has 25 sections including the phrase "X shall not participate in overload resolution ...". Most of these uses are double negatives, which are hard to interpret. "shall not ... unless" tends to be the easiest to read, since the condition is true when the function is available, but we also have a lot of "if X is not Y, then Z shall not participate", which actually means "You can call Z if X is Y." The current wording is also clumsy and long-winded. We should find a better and more concise phrasing.
As an initial proposal, I'd suggest using "X is enabled if and only if Y" in prose and adding an "Enabled If: ..." element to 16.4.1.4 [structure.specifications]. Daniel: I suggest to name this new specification element for 16.4.1.4 [structure.specifications] as "Template Constraints:" instead, because the mentioned wording form was intentionally provided starting with LWG 1237 to give implementations more freedom to realize the concrete constraints. Instead of the original std::enable_if-based specifications we can use better forms of "SFINAE" constraints today and it eases the path to possible language-based constraints in the future.[2019-03-21; Daniel comments ]
Apparently the adoption of P0788R3 at the Rapperswil 2018 meeting has resolved this issue by introduction of the new Constraints: element.
Rationale:
Resolved by P0788R3.Proposed resolution:
Section: 29.5.4.2 [fpos.operations] Status: Tentatively Resolved Submitter: Great Britain Opened: 2016-11-09 Last modified: 2019-03-26
Priority: 4
View other active issues in [fpos.operations].
View all other issues in [fpos.operations].
View all issues with Tentatively Resolved status.
Discussion:
Addresses GB 60
The requirements on the stateT type used to instantiate class template fpos are not clear, and the following Table 108 — "Position type requirements" is a bit of a mess. This is old wording, and should be cleaned up with better terminology from the Clause 17 Requirements. For example, stateT might be require CopyConstructible?, CopyAssignable?, and Destructible. Several entries in the final column of the table appear to be post-conditions, but without the post markup to clarify they are not assertions or preconditions. They frequently refer to identifiers that do not apply to all entries in their corresponding Expression column, leaving some expressions without a clearly defined semantic. If stateT is a trivial type, is fpos also a trivial type, or is a default constructor not required/supported?
Proposed change:
Clarify the requirements and the table.[Issues Telecon 16-Dec-2016]
Priority 4; no consensus for any concrete change
[2019-03-17; Daniel comments]
With the acceptance of P0759R1 at the Rapperswil 2018 meeting this issue should be closed as Resolved (Please note that this paper resolves a historic NB comment that was originally written against C++17 but was at that time responded: "invite a paper if anybody wants to change it - no concensus for change").
Rationale:
Resolved by P0759R1.Proposed resolution:
Section: 29.5.4.2 [fpos.operations] Status: Tentatively Resolved Submitter: Jens Maurer Opened: 2016-11-24 Last modified: 2019-03-26
Priority: 3
View other active issues in [fpos.operations].
View all other issues in [fpos.operations].
View all issues with Tentatively Resolved status.
Discussion:
This is from editorial issue #1031.
The first row in Table 112 "Position type requirements" talks about the expression P(i) and then has an assertion p == P(i). However, there are no constraints on p other than being of type P, so (on the face of it) this seems to require that operator== on P always returns true, which is non-sensical.[2017-01-27 Telecon]
Priority 3
[2019-03-17; Daniel comments]
With the acceptance of P0759R1 at the Rapperswil 2018 meeting this issue should be closed as Resolved.
Rationale:
Resolved by P0759R1.Proposed resolution:
Section: 16.4.2.1 [expos.only.func] Status: Tentatively Resolved Submitter: Marshall Clow Opened: 2017-07-11 Last modified: 2019-06-17
Priority: 3
View all issues with Tentatively Resolved status.
Discussion:
[thread.decaycopy] says:
In several places in this Clause the operation DECAY_COPY(x) is used. All such uses mean call the function decay_copy(x) and use the result, where decay_copy is defined as follows:
but decay_copy is not defined in any synopsis.
The Ranges TS has a similar use of DECAY_COPY, except that theirs is also constexpr and noexcept. We should mark the function decay_copy as "exposition only" and constexpr and noexcept.[2017-07-16, Daniel comments]
Currently there exists no proper way to mark decay_copy as conditionally noexcept as explained in N3255 section "Adding to the Standard". This is also slighly related to the request to add an is_nothrow_convertible trait, as requested by LWG 2040.
[ 2017-11-01 P3 as result of c++std-lib online vote. ]
[2019-03-22; Daniel comments]
Starting with N4800 have now a constexpr and conditionally noexcept decay-copy in the working draft (16.4.2.1 [expos.only.func]). The pre-condition for that specification helper became possible by adoption of P0758R1, which introduced the missing is_nothrow_convertible trait.
Rationale:
Resolved by editorial creation of decay-copy after acceptance of P0758R1.Proposed resolution:
Section: 25.5.10 [mismatch] Status: Tentatively Resolved Submitter: Geoffrey Romer Opened: 2018-12-20 Last modified: 2019-03-26
Priority: 0
View all other issues in [mismatch].
View all issues with Tentatively Resolved status.
Discussion:
Consider the following code:
std::vector<int> v1 = {1, 2, 3, 4}; std::vector<int> v2 = {1, 2, 3, 5}; auto result = std::mismatch(v1.begin(), v1.begin() + 2, v2.begin(), v2.begin() + 2);
The current wording of [mismatch] seems to require result to be {v1.begin() + 3, v2.begin() + 3}, because 3 is the smallest integer n such that *(v1.begin() + n) != *(v2.begin + n). In other words, if there's a mismatch that's reachable from first1 and first2, then std::mismatch must find and return it, even if it's beyond the end iterators passed by the user.
This is doubly unimplementable: the library has no way of knowing that it's safe to keep going past the end of the user-supplied range, and even if it could, doing so would violate the complexity requirements. More importantly, it would violate the fundamental convention that STL algorithms operate on user-supplied ranges, not on the underlying containers.[2019-01-26 Priority to 0 and Status to Tentatively Ready after discussions on the reflector]
During that reflector discussion several contributers argued in favour for changing the current wording in 25.5.10 [mismatch] p3 from "smallest integer" to "smallest nonnegative integer". This minor wording delta has also been added to the original proposed wording.
Previous resolution [SUPERSEDED]:
This wording is relative to N4791.
Change 25.5.10 [mismatch] as indicated:
template<class InputIterator1, class InputIterator2> constexpr pair<InputIterator1, InputIterator2> mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); […] namespace ranges { template<InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2, class Proj1 = identity, class Proj2 = identity, IndirectRelation<projected<I1, Proj1>, projected<I2, Proj2>> Pred = ranges::equal_to<>> constexpr mismatch_result<I1, I2> mismatch(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); template<InputRange R1, InputRange R2, class Proj1 = identity, class Proj2 = identity, IndirectRelation<projected<iterator_t<R1>, Proj1>, projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to<>> constexpr mismatch_result<safe_iterator_t<R1>, safe_iterator_t<R2>> mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); }-1- Let last2 be first2 + (last1 - first1) for the overloads with no parameter last2 or r2.
-2- Let E be:-?- Let N be min(last1 - first1, last2 - first2). -3- Returns: { first1 + n, first2 + n }, where n is the smallest nonnegative integer such that E holds, or
(2.1) — !(*(first1 + n) == *(first2 + n)) for the overloads with no parameter pred,
(2.2) — pred(*(first1 + n), *(first2 + n)) == false for the overloads with a parameter pred and no parameter proj1,
(2.3) — !invoke(pred, invoke(proj1, *(first1 + n)), invoke(proj2, *(first2 + n))) for the overloads with both parameters pred and proj1.
min(last1 - first1, last2 - first2)N if no such integer less than N exists. -4- Complexity: At mostmin(last1 - first1, last2 - first2)N applications of the corresponding predicate and any projections.
[2019-03-15; Daniel comments]
The editorial issue #2611 had been resolved via this pull request #2613. The editorial changes should make the suggested wording changes obsolete and I recommend to close this issue as Resolved.
Rationale:
Resolved by editorial pull request #2613.Proposed resolution:
Section: 23.7 [iterator.range] Status: Tentatively NAD Submitter: Nevin Liber Opened: 2019-05-23 Last modified: 2019-06-16
Priority: Not Prioritized
View other active issues in [iterator.range].
View all other issues in [iterator.range].
Discussion:
The N in ssize(const T (&)[N]) is specified to be of type ptrdiff_t. It should be size_t to be consistent with the rest of the standard library, such as the array overloads for all other range access functions, the swap overload for arrays, and other function template overloads for arrays. (Note: the return type of this function should still be ptrdiff_t.)
[2019-06-12 Tentatively NAD after reflector discussion]
Proposed resolution:
This wording is relative to N4810.
Modify 23.7 [iterator.range] as indicated:
template<class T,ptrdiffsize_t N> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept;-19- Returns: static_cast<ptrdiff_t>(N).
Section: 27.13 [time.parse] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-13 Last modified: 2019-07-23
Priority: 0
View other active issues in [time.parse].
View all other issues in [time.parse].
View all issues with Tentatively Ready status.
Discussion:
Currently, the '%d
' parse flags accepts the 'E
' modifier to parse the
locale's alternative representation, see Table 88 —
"Meaning of parse
flags":
The modified command
%Ed
interprets the locale's alternative representation of the day of the month.
This is inconsistent with the
POSIX
strftime
specification and the format functions, that uses 'O
'
to output alternate locale representation. Per Table 87 —
"Meaning of format
conversion specifiers":
The modified command
%Od
produces the locale's alternative representation.
[2019-06-24; Howard comments]
This was simply a type-o in my documentation that infected the proposal and subsequently the C++ working draft.
None of std::time_put, C's strftime, or POSIX's strftime support %Ed but all support %Od. Furthermore the existing example implementation supports %Od but not %Ed. And all the existing example implementation does is forward to std::time_put.[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4810.
Modify 27.13 [time.parse], Table 88 — "Meaning of parse
flags",
as indicated:
Table 88 — Meaning of parse
flagsFlag Parsed value […] %d The day of the month as a decimal number. The modified command %Nd specifies the maximum number of characters to read. If N is not specified, the default is 2. Leading zeroes are permitted but not required. The modified command % EOd interprets the locale's alternative representation of the day of the month.[…]
Section: 27.8.13.3 [time.cal.ym.nonmembers] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-16 Last modified: 2019-07-23
Priority: 0
View all issues with Tentatively Ready status.
Discussion:
The current specification of the addition of year_month
and
months
does not define a unique result value.
year(2019)/month(1)
and year(2018)/month(13)
are valid results of year(2018)/month(12) + months(1)
addition,
according to the spec in 27.8.13.3 [time.cal.ym.nonmembers].
[2019-06-24; LWG discussion]
During discussions on the LWG reflector there was a preference to add "is true" at the end of the modified Returns: element. This additional edit has been applied to Tomasz' original wording below.
[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4810.
Modify 27.8.13.3 [time.cal.ym.nonmembers] as indicated:
constexpr year_month operator+(const year_month& ym, const months& dm) noexcept;-3- Returns: A year_month value z such that z.ok() && z - ym == dm is true.
Complexity: 𝒪(1) with respect to the value of dm.
Section: 25.9.8 [inclusive.scan], 25.9.10 [transform.inclusive.scan] Status: Tentatively Ready Submitter: Jonathan Wakely Opened: 2019-06-18 Last modified: 2019-07-23
Priority: 0
View all issues with Tentatively Ready status.
Discussion:
after applying P0574R1 to the working draft, 25.9.10 [transform.inclusive.scan] bullet 1.1 says "If init is provided, […]; otherwise, ForwardIterator1's value type shall be […]." 25.9.10 [transform.inclusive.scan] bullet 1.2 says "If init is provided, […]; otherwise, […] shall be convertible to ForwardIterator1's value type."
For the first overload init is not provided, but there is no ForwardIterator1, so these requirements cannot be met. The requirements for the first overload need to be stated in terms of InputIterator's value type, not ForwardIterator1's value type. The same problem exists in 25.9.8 [inclusive.scan]. 25.9.11 [adjacent.difference] solves this problem by saying "Let T be the value type of decltype(first)".[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
Modify 25.9.8 [inclusive.scan] as indicated:
template<class InputIterator, class OutputIterator, class BinaryOperation> OutputIterator inclusive_scan(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op); template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class BinaryOperation> ForwardIterator2 inclusive_scan(ExecutionPolicy&& exec, ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, BinaryOperation binary_op); template<class InputIterator, class OutputIterator, class BinaryOperation, class T> OutputIterator inclusive_scan(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op, T init); template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class BinaryOperation, class T> ForwardIterator2 inclusive_scan(ExecutionPolicy&& exec, ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, BinaryOperation binary_op, T init);-?- Let U be the value type of decltype(first).
-3- Requires:
(3.1) — If init is provided, T shall be Cpp17MoveConstructible (Table 26); otherwise,
ForwardIterator1's value typeU shall be Cpp17MoveConstructible.(3.2) — If init is provided, all of binary_op(init, init), binary_op(init, *first), and binary_op(*first, *first) shall be convertible to T; otherwise, binary_op(*first, *first) shall be convertible to
ForwardIterator1's value typeU.(3.3) — binary_op shall neither invalidate iterators or subranges, nor modify elements in the ranges [first, last] or [result, result + (last - first)].
Modify 25.9.10 [transform.inclusive.scan] as indicated:
template<class InputIterator, class OutputIterator, class BinaryOperation, class UnaryOperation> OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op, UnaryOperation unary_op); template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class BinaryOperation, class UnaryOperation> ForwardIterator2 transform_inclusive_scan(ExecutionPolicy&& exec, ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, BinaryOperation binary_op, UnaryOperation unary_op); template<class InputIterator, class OutputIterator, class BinaryOperation, class UnaryOperation, class T> OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op, UnaryOperation unary_op, T init); template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class BinaryOperation, class UnaryOperation, class T> ForwardIterator2 transform_inclusive_scan(ExecutionPolicy&& exec, ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, BinaryOperation binary_op, UnaryOperation unary_op, T init);-?- Let U be the value type of decltype(first).
-1- Requires:
(1.1) — If init is provided, T shall be Cpp17MoveConstructible (Table 26); otherwise,
ForwardIterator1's value typeU shall be Cpp17MoveConstructible.(1.2) — If init is provided, all of
(1.2.1) — binary_op(init, init),
(1.2.2) — binary_op(init, unary_op(*first)), and
(1.2.3) — binary_op(unary_op(*first), unary_op(*first))
shall be convertible to T; otherwise, binary_op(unary_op(*first), unary_op(*first)) shall be convertible to
ForwardIterator1's value typeU.(1.3) — Neither unary_op nor binary_op shall invalidate iterators or subranges, nor modify elements in the ranges [first, last] or [result, result + (last - first)].
Section: 27.11.7.2 [time.zone.zonedtime.ctor] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-20 Last modified: 2019-07-23
Priority: 0
View other active issues in [time.zone.zonedtime.ctor].
View all other issues in [time.zone.zonedtime.ctor].
View all issues with Tentatively Ready status.
Discussion:
The zoned_time(TimeZonePtr z)
does not specify how the tp_
sub-element is initialized. It should be consistent with zoned_time(string_view)
that default initializes tp_
.
[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
Modify 27.11.7.2 [time.zone.zonedtime.ctor] as indicated:
explicit zoned_time(TimeZonePtr z);-5- Requires: z refers to a time zone.
-6- Effects: Constructs a zoned_time by initializing zone_ with std::move(z) and default constructing tp_.
Section: 27.11.7.2 [time.zone.zonedtime.ctor] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-20 Last modified: 2019-07-23
Priority: 0
View other active issues in [time.zone.zonedtime.ctor].
View all other issues in [time.zone.zonedtime.ctor].
View all issues with Tentatively Ready status.
Discussion:
The zoned_time
constructor from zoned_time<Duration2,
TimeZonePtr>
(preserving same time zone, different precision of
representation) is currently marked noexcept. Given that the exposition-only
member tp_ of type sys_time<duration> has essentially type
time_point<system_clock, Duration>, this is incompatible with the
invoked time_point
constructor, which is not marked as noexcept.
[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
Modify 27.11.7.1 [time.zone.zonedtime.overview], class template zoned_time synopsis, as indicated:
template<class Duration2> zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt)noexcept;
Modify 27.11.7.2 [time.zone.zonedtime.ctor] as indicated:
template<class Duration2> zoned_time(const zoned_time<Duration2, TimeZonePtr>& y)noexcept;-9- Requires: Does not participate in overload resolution unless sys_time<Duration2> is implicitly convertible to sys_time<Duration>.
-10- Effects: Constructs a zoned_time by initializing zone_ with y.zone_ and tp_ with y.tp_.
Section: 27.13 [time.parse] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-29 Last modified: 2019-07-23
Priority: 0
View other active issues in [time.parse].
View all other issues in [time.parse].
View all issues with Tentatively Ready status.
Discussion:
The year format specifier ('y', 'Y') are missing the locale alternative
version ('%EY', '%Ey' and '%Oy'). That makes it inconsistent with the
POSIX
strftime
specification:
%Ey Replaced by the offset from %EC (year only) in the locale's alternative representation.
%EY Replaced by the full alternative year representation.
%Oy Replaced by the year (offset from %C) using the locale's alternative numeric symbols.
and parse
specifiers 27.13 [time.parse] that accepts these modified command.
[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
[Drafting note: For the '%Oy' specifier we preserve consistency with the current specification for '%Od' and '%Oe' from Table 87 "Meaning of
format
conversion specifier" [tab:time.format.spec]:
%d […] The modified command
%Od
produces the locale's alternative representation.%e […] The modified command
%Oe
produces the locale's alternative representation.as their corresponding POSIX specification is matching one for '%Oy':
%Od Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading <space> characters.
%Oe Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading <space> characters.
]
Modify "Table 87 — Meaning of format
conversion specifiers"
[tab:time.format.spec] as indicated:
Table 87 — Meaning of format conversion specifiers [tab:time.format.spec] Specifier Replacement […] %y The last two decimal digits of the year. If the result is a single digit it is prefixed by 0. The modified command %Oy
produces the locale's alternative representation. The modified command%Ey
produces the locale's alternative representation of offset from%EC
(year only).%Y The year as a decimal number. If the result is less than four digits it is left-padded with 0 to four digits. The modified command %EY
produces the locale's alternative full year representation.[…]
Section: 27.8.15.2 [time.cal.ymdlast.members] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-29 Last modified: 2019-08-05
Priority: 0
View all issues with Tentatively Ready status.
Discussion:
The current specification of the year_month_day_last::day
function does not cover the behaviour in the situation when year_month_day_last
value is not ok()
. To illustrate the sentence from
27.8.15.2 [time.cal.ymdlast.members] p13:
A
day
representing the last day of the (year
,month
) pair represented by*this
.
is unclear in the situation when month
member has
!ok
value, e.g. what is last day of 14th month of 2019.
ymdl.day()
(and by
consequence conversion to sys_days
/local_days
)
unspecified if ymdl.ok()
is false
. This make is
consistent with rest of the library, that produces unspecified values in
similiar situation, e.g.: 27.8.14.2 [time.cal.ymd.members] p18,
27.8.16.2 [time.cal.ymwd.members] p19,
27.8.17.2 [time.cal.ymwdlast.members] p14.
[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
Modify 27.8.15.2 [time.cal.ymdlast.members] as indicated:
constexpr chrono::day day() const noexcept;-13- Returns: If ok() is true, returns a
-14- [Note: This value may be computed on demand. — end note]Aday representing the last day of the (year, month) pair represented by *this. Otherwise the returned value is unspecified.
Section: 27.11.7.1 [time.zone.zonedtime.overview] Status: Tentatively Ready Submitter: Tomasz Kamiński Opened: 2019-06-30 Last modified: 2019-07-23
Priority: 0
View all issues with Tentatively Ready status.
Discussion:
Currently, the time_zone
is always storing the time with
the precision not coarser that seconds
, as consequence any
instance with the duration with coarser precision with seconds
,
is de-facto equivalent to one instantiated to the duration of seconds.
This is caused by the fact, that time zone offset can be defined up to
seconds precision. To illustrate both of following specialization has
the same behavior (keep seconds
):
zoned_time<minutes> zt(current_zone(), floor<minutes>(system_clock::now()); zoned_time<hours> zt(current_zone(), floor<hours>(system_clock::now()); zoned_time<seconds> zt(current_zone(), floor<seconds>(system_clock::now());
To avoid unnecessary code bloat caused by above, most deduction guides
are instantiating zoned_time
with at least seconds
precision (i.e. zoned_time<seconds>
will be deduced
for all of above):
template<class TimeZonePtr, class Duration> zoned_time(TimeZonePtr, zoned_time<Duration>, choose = choose::earliest) -> zoned_time<common_type_t<Duration, seconds>, TimeZonePtr>;
However there is single exception:
template<class Duration, class TimeZonePtr, class TimeZonePtr2> zoned_time(TimeZonePtr, zoned_time<Duration, TimeZonePtr2>, choose = choose::earliest) -> zoned_time<Duration, TimeZonePtr>;
This deduction guide should be updated to preserve the consistency of design.
[2019-07 Issue Prioritiztion]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
Modify 27.11.7.1 [time.zone.zonedtime.overview] as indicated:
[…] template<class Duration, class TimeZonePtr, class TimeZonePtr2> zoned_time(TimeZonePtr, zoned_time<Duration, TimeZonePtr2>, choose = choose::earliest) -> zoned_time<common_type_t<Duration, seconds>, TimeZonePtr>; […]