This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

2972. What is is_trivially_destructible_v<int>?

Section: [meta.unary.prop] Status: WP Submitter: Richard Smith Opened: 2017-06-01 Last modified: 2017-11-13

Priority: Not Prioritized

View other active issues in [meta.unary.prop].

View all other issues in [meta.unary.prop].

View all issues with WP status.


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.

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

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

Proposed resolution:

This wording is relative to 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.