Re: C++ question about auto_ptr

2015-05-09 Thread Jean-Marc Lasgouttes
Le 09/05/2015 09:18, Abdelrazak Younes a écrit : On 08/05/2015 22:13, Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. Why that? unique_ptr is supported since

Re: C++ question about auto_ptr

2015-05-09 Thread Abdelrazak Younes
On 09/05/2015 11:37, Jean-Marc Lasgouttes wrote: Le 09/05/2015 09:18, Abdelrazak Younes a écrit : On 08/05/2015 22:13, Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather

Re: C++ question about auto_ptr

2015-05-09 Thread Jean-Marc Lasgouttes
Le 08/05/2015 23:10, Georg Baum a écrit : I have many places like in the patch below. Is there a reason why I should keep the auto_ptr instead of a naked pointer? What is it good for? Usually it is used for exception safety: If you use a raw pointer, you need to delete it in the catch clause,

Re: C++ question about auto_ptr

2015-05-09 Thread Abdelrazak Younes
On 08/05/2015 22:13, Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. Why that? unique_ptr is supported since gcc 4.4 released in 2009:

Re: C++ question about auto_ptr

2015-05-09 Thread Abdelrazak Younes
On 08/05/2015 22:13, Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. Why that? unique_ptr is supported since gcc 4.4 released in 2009:

Re: C++ question about auto_ptr

2015-05-09 Thread Jean-Marc Lasgouttes
Le 09/05/2015 09:18, Abdelrazak Younes a écrit : On 08/05/2015 22:13, Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. Why that? unique_ptr is supported since

Re: C++ question about auto_ptr

2015-05-09 Thread Abdelrazak Younes
On 09/05/2015 11:37, Jean-Marc Lasgouttes wrote: Le 09/05/2015 09:18, Abdelrazak Younes a écrit : On 08/05/2015 22:13, Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather

Re: C++ question about auto_ptr

2015-05-09 Thread Jean-Marc Lasgouttes
Le 08/05/2015 23:10, Georg Baum a écrit : I have many places like in the patch below. Is there a reason why I should keep the auto_ptr instead of a naked pointer? What is it good for? Usually it is used for exception safety: If you use a raw pointer, you need to delete it in the catch clause,

C++ question about auto_ptr

2015-05-08 Thread Jean-Marc Lasgouttes
With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. I have many places like in the patch below. Is there a reason why I should keep the auto_ptr instead of a naked pointer? What is it good

Re: C++ question about auto_ptr

2015-05-08 Thread Georg Baum
Jean-Marc Lasgouttes wrote: With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. Why not use unique_ptr fpr C++11 and auto_ptr else? The difference is in the copying semantics, which does

C++ question about auto_ptr

2015-05-08 Thread Jean-Marc Lasgouttes
With C++11, auto_ptr is deprecated and we get warnings. I am trying to see how we can get rid of it. unique_ptr is new to C++11, so I'd rather avoid that. I have many places like in the patch below. Is there a reason why I should keep the auto_ptr instead of a naked pointer? What is it good

Re: C++ question about auto_ptr

2015-05-08 Thread Georg Baum
Jean-Marc Lasgouttes wrote: > With C++11, auto_ptr is deprecated and we get warnings. > > I am trying to see how we can get rid of it. unique_ptr is new to C++11, > so I'd rather avoid that. Why not use unique_ptr fpr C++11 and auto_ptr else? The difference is in the copying semantics, which