Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::owner_less

      From cppreference.com
      <cpp‎ |memory
       
       
      Memory management library
      (exposition only*)
      Allocators
      Uninitialized memory algorithms
      Constrained uninitialized memory algorithms
      Memory resources
      Uninitialized storage(until C++20)
      (until C++20*)
      (until C++20*)
      Garbage collector support(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
       
      Defined in header<memory>
      template<>
      struct owner_less<void>;
      (since C++17)

      std::owner_less<void> is a specialization ofstd::owner_less with parameter types deduced.

      Contents

      [edit]Nested types

      Nested type Definition
      is_transparentunspecified

      [edit]Member functions

      operator()
      compares its arguments using owner-based semantics
      (function)

      std::owner_less<void>::operator()

      template<class T,class U>

      bool operator()(conststd::shared_ptr<T>& lhs,

                       conststd::shared_ptr<U>& rhs)constnoexcept;
      (since C++17)
      template<class T,class U>

      bool operator()(conststd::shared_ptr<T>& lhs,

                       conststd::weak_ptr<U>& rhs)constnoexcept;
      (since C++17)
      template<class T,class U>

      bool operator()(conststd::weak_ptr<T>& lhs,

                       conststd::shared_ptr<U>& rhs)constnoexcept;
      (since C++17)
      template<class T,class U>

      bool operator()(conststd::weak_ptr<T>& lhs,

                       conststd::weak_ptr<U>& rhs)constnoexcept;
      (since C++17)

      Compareslhs andrhs using owner-based semantics. Effectively callslhs.owner_before(rhs).

      The ordering is strict weak ordering relation.

      lhs andrhs are equivalent only if they are both empty or share ownership.

      Parameters

      lhs, rhs - shared-ownership pointers to compare

      Return value

      true iflhs isless thanrhs as determined by the owner-based ordering.

      [edit]Notes

      Feature-test macroValueStdFeature
      __cpp_lib_transparent_operators201510L(C++17)Transparentstd::owner_less (std::owner_less<void>)

      [edit]See also

      provides owner-based ordering of shared pointers
      (public member function ofstd::shared_ptr<T>)[edit]
      provides owner-based ordering of weak pointers
      (public member function ofstd::weak_ptr<T>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/memory/owner_less_void&oldid=168346"

      [8]ページ先頭

      ©2009-2025 Movatter.jp