diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-04-13 19:29:08 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-04-13 19:29:08 +0000 |
commit | c5a7892285f1fbee5da5aa936ceedee2bb1afb6c (patch) | |
tree | 67e3ed5d7e61716934da3f974f2881759190bc83 /cpp/include/Ice/Proxy.h | |
parent | Reduced size of generated code (diff) | |
download | ice-c5a7892285f1fbee5da5aa936ceedee2bb1afb6c.tar.bz2 ice-c5a7892285f1fbee5da5aa936ceedee2bb1afb6c.tar.xz ice-c5a7892285f1fbee5da5aa936ceedee2bb1afb6c.zip |
fixed build failure with GCC
Diffstat (limited to 'cpp/include/Ice/Proxy.h')
-rw-r--r-- | cpp/include/Ice/Proxy.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index e3f8902ea98..8e11ab12492 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -419,6 +419,64 @@ namespace IceInternal { // +// Inline comparison functions for proxies +// +template<typename T, typename U> +inline bool operator==(const ProxyHandle<T>& lhs, const ProxyHandle<U>& rhs) +{ + ::IceProxy::Ice::Object* l = upCast(lhs.get()); + ::IceProxy::Ice::Object* r = upCast(rhs.get()); + if(l && r) + { + return *l == *r; + } + else + { + return !l && !r; + } +} + +template<typename T, typename U> +inline bool operator!=(const ProxyHandle<T>& lhs, const ProxyHandle<U>& rhs) +{ + return !operator==(lhs, rhs); +} + +template<typename T, typename U> +inline bool operator<(const ProxyHandle<T>& lhs, const ProxyHandle<U>& rhs) +{ + ::IceProxy::Ice::Object* l = upCast(lhs.get()); + ::IceProxy::Ice::Object* r = upCast(rhs.get()); + if(l && r) + { + return *l < *r; + } + else + { + return !l && r; + } +} + +template<typename T, typename U> +inline bool operator<=(const ProxyHandle<T>& lhs, const ProxyHandle<U>& rhs) +{ + return lhs < rhs || lhs == rhs; +} + +template<typename T, typename U> +inline bool operator>(const ProxyHandle<T>& lhs, const ProxyHandle<U>& rhs) +{ + return !(lhs < rhs || lhs == rhs); +} + +template<typename T, typename U> +inline bool operator>=(const ProxyHandle<T>& lhs, const ProxyHandle<U>& rhs) +{ + return !(lhs < rhs); +} + + +// // checkedCast and uncheckedCast functions without facet: // template<typename P> P |