Hi,

On 29-06-16 15:57, Samuel Pitoiset wrote:


On 06/29/2016 03:55 PM, Hans de Goede wrote:
Hi,

On 29-06-16 15:27, Ilia Mirkin wrote:
For those of us who are lazy and forgetful (i.e. me), can you remind
the difference between auto_ptr and unique_ptr? IIRC unique_ptr is
more like scoped_ptr, while auto_ptr has transfer semantics?

Actually I had to look this up myself (before writing the patch),
I found the 2nd answer here:

http://stackoverflow.com/questions/3697686/why-is-auto-ptr-being-deprecated

http://www.cplusplus.com/reference/memory/auto_ptr/

"This class template is deprecated as of C++11. unique_ptr is a new facility with a 
similar functionality[...]"

Right similar, but not *the same*, please see the 2nd answer from my
link, I believe I fixed this the right way, but a second pair of
eyes certainly cannot hurt.

Regards,

Hans




To be the best / clearest explanation and I used that to choose unique_ptr
as replacement.

Regards,

Hans


On Wed, Jun 29, 2016 at 8:38 AM, Hans de Goede <hdego...@redhat.com>
wrote:
Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h
b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h
index 7b0de85..c619499 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h
@@ -94,7 +94,11 @@ public:
    virtual void reset() { assert(0); } // only for graph iterators
 };

+#if __cplusplus >= 201103L
+typedef std::unique_ptr<Iterator> IteratorRef;
+#else
 typedef std::auto_ptr<Iterator> IteratorRef;
+#endif

 class ManipIterator : public Iterator
 {
--
2.7.4


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to