Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:MoveAssignable(since C++11)

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

      Specifies that an instance of the type can be assigned from anrvalue argument.

      [edit]Requirements

      The typeT satisfiesMoveAssignable if

      Given

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

      ExpressionReturn typeReturn valuePost-conditions
      t= rvT&tIft andrv do not refer to the same object, the value oft is equivalent to the value ofrv before the assignment.

      The new value ofrv is unspecified.

      [edit]Notes

      The type does not have to implementmove assignment operator in order to satisfy this type requirement: acopy assignment operator that takes its parameter by value or as aconst Type&, will bind to rvalue argument.

      If aMoveAssignable class implements a move assignment operator, it may also implementmove semantics to take advantage of the fact that the value ofrv after assignment is unspecified.

      [edit]See also

      checks if a type has a move assignment operator
      (class template)[edit]
      specifies that a type is assignable from another type
      (concept)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/MoveAssignable&oldid=156435"

      [8]ページ先頭

      ©2009-2025 Movatter.jp