HashTraits<RawPtr> uses 'nullptr'

It is now agreed in blink that 'nullptr' is used
to represent a null value for smart pointers.
This patch makes HashTraits<RawPtr> use 'nullptr_t'
as 'EmptyValueType' making it consistent with
HashTraits<RefPtr> and HashTraits<OwnPtr>.

Review URL: https://codereview.chromium.org/185903002

git-svn-id: svn://svn.chromium.org/blink/trunk@168520 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 83b86e5a
......@@ -191,6 +191,12 @@ namespace WTF {
};
template<typename T> struct HashTraits<RawPtr<T> > : SimpleClassHashTraits<RawPtr<T> > {
typedef std::nullptr_t EmptyValueType;
static EmptyValueType emptyValue() { return nullptr; }
static const bool hasIsEmptyValueFunction = true;
static bool isEmptyValue(const RawPtr<T>& value) { return !value; }
static const bool needsDestruction = false;
typedef T* PeekInType;
typedef T* PassInType;
......@@ -207,7 +213,10 @@ namespace WTF {
static void store(const U& value, RawPtr<T>& storage) { storage = value; }
static PeekOutType peek(const RawPtr<T>& value) { return value; }
static PeekOutType peek(std::nullptr_t) { return 0; }
static PassOutType passOut(const RawPtr<T>& value) { return value; }
static PassOutType passOut(std::nullptr_t) { return 0; }
};
template<> struct HashTraits<String> : SimpleClassHashTraits<String> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment