Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:Destructible

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      Specifies that an instance of the type can be destructed.

      [edit]Requirements

      The typeT satisfiesDestructible if

      Given

      • u, an expression of typeT.

      The following expressions must be valid and have their specified effects.

      ExpressionPost-conditions
      u.~T()All resources owned byu are reclaimed, no exceptions are thrown.

      [edit]Notes

      Destructors are called implicitly at the end ofobject lifetime such as when leavingscope or by thedelete-expression. Explicit destructor call as shown in the type requirement table is rare.

      Thanks topseudo destructor call, all scalar types meet the requirement ofDestructible, while array types and reference types do not. Note thatstd::is_destructible allows arrays and reference types.

      [edit]See also

      checks if a type has a non-deleted destructor
      (class template)[edit]
      specifies that an object of the type can be destroyed
      (concept)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/Destructible&oldid=156437"

      [8]ページ先頭

      ©2009-2025 Movatter.jp