mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-19 06:06:54 -06:00
Core: operator==(T, Value) is now resolving type compatibility (instead of crashing)
git-svn-id: svn://ultimatepp.org/upp/trunk@4904 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
477d74ae6d
commit
b5893f18c3
2 changed files with 10 additions and 4 deletions
|
|
@ -285,6 +285,12 @@ NAMESPACE_UPP
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef flagOLD_VALUE
|
||||
#ifdef SVO_VALUE
|
||||
#undef SVO_VALUE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "OldValue.h"
|
||||
|
||||
#include "Value.h"
|
||||
|
|
|
|||
|
|
@ -260,10 +260,10 @@ inline unsigned ValueGetHashValue(const T& x) {
|
|||
}
|
||||
|
||||
#define VALUE_COMPARE_V(T, VT) \
|
||||
inline bool operator==(const Value& v, T x) { return (VT)v == x; } \
|
||||
inline bool operator==(T x, const Value& v) { return (VT)v == x; } \
|
||||
inline bool operator!=(const Value& v, T x) { return (VT)v != x; } \
|
||||
inline bool operator!=(T x, const Value& v) { return (VT)v != x; } \
|
||||
inline bool operator==(const Value& v, T x) { return v.Is<VT>() ? (VT)v == x : v == Value(x); } \
|
||||
inline bool operator==(T x, const Value& v) { return v.Is<VT>() ? (VT)v == x : v == Value(x); } \
|
||||
inline bool operator!=(const Value& v, T x) { return v.Is<VT>() ? (VT)v != x : v != Value(x); } \
|
||||
inline bool operator!=(T x, const Value& v) { return v.Is<VT>() ? (VT)v != x : v != Value(x); } \
|
||||
|
||||
#define VALUE_COMPARE(T) VALUE_COMPARE_V(T, T)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue