#86996# +OInterfaceCompare

This commit is contained in:
Frank Schönheit 2001-05-25 09:48:01 +00:00
parent 9a4b7ef3ee
commit 1e8ee04e30

View file

@ -2,9 +2,9 @@
*
* $RCSfile: stl_types.hxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: pl $ $Date: 2001-05-10 12:21:01 $
* last change: $Author: fs $ $Date: 2001-05-25 10:48:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -151,6 +151,28 @@ public:
sal_Bool isCaseSensitive() const {return m_bCaseSensitive;}
};
//=====================================================================
//= OInterfaceCompare
//=====================================================================
/** is stl-compliant structure for comparing Reference< <iface> > instances
*/
template < class IAFCE >
struct OInterfaceCompare
:public ::std::binary_function < ::com::sun::star::uno::Reference< IAFCE >
, ::com::sun::star::uno::Reference< IAFCE >
, bool
>
{
bool operator() (const ::com::sun::star::uno::Reference< IAFCE >& lhs, const ::com::sun::star::uno::Reference< IAFCE >& rhs) const
{
return lhs.get() < rhs.get();
// this does not make any sense if you see the semantics of the pointer returned by get:
// It's a pointer to a point in memory where an interface implementation lies.
// But for our purpose (provide a reliable less-operator which can be used with the STL), this is
// sufficient ....
}
};
//.........................................................................
}
//... namespace comphelper ................................................