Title
What is is_trivially_destructible_v<int>?
Status
c++20
Section
[meta.unary.prop]
Submitter
Richard Smith

Created on 2017-06-01.00:00:00 last changed 46 months ago

Messages

Date: 2017-07-05.19:30:12
This wording is relative to

Proposed resolution:

N4659.
  1. Change [meta.unary.prop], Table 42 — "Type property predicates", as indicated:

    Table 22 — Type property predicates
    Template Condition Preconditions
    template <class T>
    struct is_trivially_destructible;
    is_destructible_v<T> is true and the indicated destructor is known to be trivialremove_all_extents_t<T> is either a non-class type or a class type with a trivial destructor. T shall be a complete type, cv void, or an array of unknown bound.
Date: 2017-07-05.00:00:00

[ 2017-07-05 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Date: 2017-06-15.00:00:00

[ 2017-06-14, Daniel and Jonathan provide wording ]

Date: 2017-06-01.00:00:00

The spec for is_trivially_destructible says the value is true if "is_destructible_v<T> is true and the indicated destructor is known to be trivial."

For a case like is_trivially_destructible_v<int>, there is no indicated destructor, so it's unclear what value the trait would have but the most plausible reading of these words is that it should be false. However, I'm confident the intent is that this trait should yield true in that situation, and that's what all the implementations I can find actually do.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2017-11-13 19:01:36adminsetstatus: voting -> wp
2017-10-17 18:34:55adminsetstatus: ready -> voting
2017-07-05 19:30:12adminsetmessages: + msg9318
2017-07-05 19:30:12adminsetstatus: new -> ready
2017-06-14 19:48:42adminsetmessages: + msg9261
2017-06-14 19:48:42adminsetmessages: + msg9260
2017-06-01 00:00:00admincreate