Declare deleted copy constructor and assignment operator of v8::Global to take const parameters.

This is required in order for Globals to be stored in STL containers.

Patch from Aaron Link <aaronlink@google.com>

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29776}
This commit is contained in:
ulan 2015-07-21 08:53:11 -07:00 committed by Commit bot
parent bb3bb6b773
commit 7f6012c093

View File

@ -638,8 +638,8 @@ template <class T> class PersistentBase {
friend class Object; friend class Object;
explicit V8_INLINE PersistentBase(T* val) : val_(val) {} explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
PersistentBase(PersistentBase& other) = delete; // NOLINT PersistentBase(const PersistentBase& other) = delete; // NOLINT
void operator=(PersistentBase&) = delete; void operator=(const PersistentBase&) = delete;
V8_INLINE static T* New(Isolate* isolate, T* that); V8_INLINE static T* New(Isolate* isolate, T* that);
T* val_; T* val_;
@ -845,8 +845,8 @@ class Global : public PersistentBase<T> {
private: private:
template <class F> template <class F>
friend class ReturnValue; friend class ReturnValue;
Global(Global&) = delete; Global(const Global&) = delete;
void operator=(Global&) = delete; void operator=(const Global&) = delete;
V8_INLINE T* operator*() const { return this->val_; } V8_INLINE T* operator*() const { return this->val_; }
}; };