// shared_ptr特殊化版
bool operator()(const shared_ptr<T>& a, const shared_ptr<T>& b) const; // (1) C++11
bool operator()(const shared_ptr<T>& a, const shared_ptr<T>& b) const noexcept; // (1) C++17
bool operator()(const shared_ptr<T>& a, const weak_ptr<T>& b) const; // (2) C++11
bool operator()(const shared_ptr<T>& a, const weak_ptr<T>& b) const noexcept; // (2) C++17
bool operator()(const weak_ptr<T>& a, const shared_ptr<T>& b) const; // (3) C++11
bool operator()(const weak_ptr<T>& a, const shared_ptr<T>& b) const noexcept; // (3) C++17
// weak_ptr特殊化版
bool operator()(const weak_ptr<T>& a, const weak_ptr<T>& b) const; // (4) C++11
bool operator()(const weak_ptr<T>& a, const weak_ptr<T>& b) const noexcept; // (4) C++17
bool operator()(const shared_ptr<T>& a, const weak_ptr<T>& b) const; // (5) C++11
bool operator()(const shared_ptr<T>& a, const weak_ptr<T>& b) const noexcept; // (5) C++17
bool operator()(const weak_ptr<T>& a, const shared_ptr<T>& b) const; // (6) C++11
bool operator()(const weak_ptr<T>& a, const shared_ptr<T>& b) const noexcept; // (6) C++17
// void特殊化版
template<class T, class U>
bool operator()(const shared_ptr<T>&, const shared_ptr<U>&) const noexcept; // (7) C++17
template<class T, class U>
bool operator()(const shared_ptr<T>&, const weak_ptr<U>&) const noexcept; // (8) C++17
template<class T, class U>
bool operator()(const weak_ptr<T>&, const shared_ptr<U>&) const noexcept; // (9) C++17
template<class T, class U>
bool operator()(const weak_ptr<T>&, const weak_ptr<U>&) const noexcept; // (10) C++17
概要
所有権ベースでの小なり比較を行う。
戻り値
a.owner_before(b)
バージョン
言語
- C++11
関連項目
参照
- LWG Issue 2873. Add
noexceptto severalshared_ptrrelated functions - P0074R0 Making
std::owner_lessmore flexible - P3037R6
constexpr std::shared_ptrand friends - LWG Issue 4557. Remove
constexprfromowner_lessandowner_before- C++26で、P3037R6により一旦付与された
constexpr指定が取り消され、owner_beforeとowner_lessのoperator()はconstexprではなくなった
- C++26で、P3037R6により一旦付与された