Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/intrusive_ptr.h

Issue 29548581: Issue 4128, 5138 - Add Parser and Serializer implemented in C++ Base URL: https://github.com/adblockplus/adblockpluscore.git
Patch Set: Created Sept. 18, 2017, 5:23 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/intrusive_ptr.h
diff --git a/compiled/intrusive_ptr.h b/compiled/intrusive_ptr.h
index 1a607ac6017406af5c83251c7cd6a12df4fda111..47533a6c451a8f5ad44f269f5aebd0ce8b93b88f 100644
--- a/compiled/intrusive_ptr.h
+++ b/compiled/intrusive_ptr.h
@@ -60,10 +60,10 @@ private:
int mRefCount;
};
-template<typename T,
- class = typename std::enable_if<std::is_base_of<ref_counted,T>::value>::type>
+template<typename T>
class intrusive_ptr
{
+ static_assert(std::is_base_of<ref_counted, T>::value, "The class T should inherit ref_counted");
public:
explicit intrusive_ptr()
: mPointer(nullptr)
@@ -119,9 +119,9 @@ public:
intrusive_ptr().swap(*this);
}
- void reset(T* other)
+ void reset(T* other, bool addRef = true)
{
- intrusive_ptr(other).swap(*this);
+ intrusive_ptr(other, addRef).swap(*this);
}
const T* get() const

Powered by Google App Engine
This is Rietveld