Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::any::reset

      From cppreference.com
      <cpp‎ |utility‎ |any
       
       
      Utilities library
       
       
      void reset()noexcept;
      (since C++17)

      If*this contains a value, destroys the contained value.

      *this does not contain a value after this call.

      Contents

      [edit]Parameters

      (none)

      [edit]Return value

      (none)

      [edit]Example

      Run this code
      #include <any>#include <cassert> int main(){std::any a{42};assert(a.has_value());    a.reset();assert(not a.has_value());}

      [edit]See also

      checks if object holds a value
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/any/reset&oldid=175522"

      [8]ページ先頭

      ©2009-2025 Movatter.jp