Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-07-01 18:13:57 +0300
committerJulian Eisel <julian@blender.org>2020-07-01 18:13:57 +0300
commit0829cebeb024095c268f190c34daa8ae9a5a224c (patch)
tree12ee5a4a1c2a32e12eff47c8eb9bb0ed217791c1 /source/blender/freestyle/intern/view_map/AutoPtrHelper.h
parentcfde6ebf450594faa57c4bfeaecff10fe512c91b (diff)
parent42be3964eb201180f6b0fa1ff6ce43b8c3845bc2 (diff)
Merge branch 'master' into asset-uuid--archivedasset-uuid--archived
Diffstat (limited to 'source/blender/freestyle/intern/view_map/AutoPtrHelper.h')
-rw-r--r--source/blender/freestyle/intern/view_map/AutoPtrHelper.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/source/blender/freestyle/intern/view_map/AutoPtrHelper.h b/source/blender/freestyle/intern/view_map/AutoPtrHelper.h
index 9da109ab2a6..fb2a9d73d13 100644
--- a/source/blender/freestyle/intern/view_map/AutoPtrHelper.h
+++ b/source/blender/freestyle/intern/view_map/AutoPtrHelper.h
@@ -26,7 +26,6 @@
namespace Freestyle {
-#if __cplusplus > 199711L
template<typename T> class AutoPtr : public std::unique_ptr<T> {
public:
AutoPtr() : std::unique_ptr<T>()
@@ -36,26 +35,16 @@ template<typename T> class AutoPtr : public std::unique_ptr<T> {
{
}
- /* TODO(sergey): Is there more clear way to do this? */
+ /* Mimic behavior of legacy auto_ptr.
+ * Keep implementation as small as possible, hens delete assignment operator. */
+
template<typename X> AutoPtr(AutoPtr<X> &other) : std::unique_ptr<T>(other.get())
{
other.release();
}
+
+ template<typename X> AutoPtr &operator=(AutoPtr<X> &other) = delete;
};
-#else
-template<typename T> class AutoPtr : public std::auto_ptr<T> {
- public:
- AutoPtr() : std::auto_ptr<T>()
- {
- }
- AutoPtr(T *ptr) : std::auto_ptr<T>(ptr)
- {
- }
- AutoPtr(std::auto_ptr_ref<T> ref) : std::auto_ptr<T>(ref)
- {
- }
-};
-#endif
} /* namespace Freestyle */