Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=bf67db25a28be13cf3d3a939e2f3cff3d038b096
commit bf67db25a28be13cf3d3a939e2f3cff3d038b096 Author: Michel Hermier <herm...@frugalware.org> Date: Mon Nov 3 08:03:35 2014 +0100 libpacman: Reorder flib::refcounted_ptr operators. diff --git a/lib/libpacman/kernel/frefcounted.h b/lib/libpacman/kernel/frefcounted.h index 2412b5d..1b05f1e 100644 --- a/lib/libpacman/kernel/frefcounted.h +++ b/lib/libpacman/kernel/frefcounted.h @@ -120,6 +120,47 @@ namespace flib T *m_refcounted_ptr; }; + template <class T, class U> + bool operator == (const refcounted_ptr<T> &lhs, const refcounted_ptr<U> &rhs) + { + return lhs.get() == rhs.get(); + } + + template <class T> + bool operator == (const refcounted_ptr<T> &lhs, std::nullptr_t rhs) + { + return lhs.get() == rhs; + } + + template <class T, class U> + bool operator != (const refcounted_ptr<T> &lhs, const refcounted_ptr<U> &rhs) + { + return lhs.get() != rhs.get(); + } + + template <class T> + bool operator != (const refcounted_ptr<T> &lhs, std::nullptr_t rhs) + { + return lhs.get() != rhs; + } +} // namespace flib + +namespace std +{ + template <class T> + bool operator == (nullptr_t lhs, const flib::refcounted_ptr<T> &rhs) + { + return lhs == rhs.get(); + } + + template <class T> + bool operator != (nullptr_t lhs, const flib::refcounted_ptr<T> &rhs) + { + return lhs != rhs.get(); + } +} // namespace std + +namespace flib { template <class T> class refcounted_shared_ptr : public refcounted_ptr<T> @@ -204,47 +245,8 @@ namespace flib super_type::swap(o); } }; - - template <class T, class U> - bool operator == (const refcounted_ptr<T> &lhs, const refcounted_ptr<U> &rhs) - { - return lhs.get() == rhs.get(); - } - - template <class T> - bool operator == (const refcounted_ptr<T> &lhs, std::nullptr_t rhs) - { - return lhs.get() == rhs; - } - - template <class T, class U> - bool operator != (const refcounted_ptr<T> &lhs, const refcounted_ptr<U> &rhs) - { - return lhs.get() != rhs.get(); - } - - template <class T> - bool operator != (const refcounted_ptr<T> &lhs, std::nullptr_t rhs) - { - return lhs.get() != rhs; - } } // namespace flib -namespace std -{ - template <class T> - bool operator == (nullptr_t lhs, const flib::refcounted_ptr<T> &rhs) - { - return lhs == rhs.get(); - } - - template <class T> - bool operator != (nullptr_t lhs, const flib::refcounted_ptr<T> &rhs) - { - return lhs != rhs.get(); - } -} // namespace std - #endif /* FREFCOUNTED_H */ /* vim: set ts=2 sw=2 noet: */ _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git