A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue2972 below:

Issue 2972: What is is_trivially_destructible_v<int>?

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

2972. What is is_trivially_destructible_v<int>?

Section: 21.3.6.4 [meta.unary.prop] Status: C++20 Submitter: Richard Smith Opened: 2017-06-01 Last modified: 2021-02-25

Priority: Not Prioritized

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

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

View all issues with C++20 status.

Discussion:

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 21.3.6.4 [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 trivial remove_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.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4