Re: [Firebird-devel] Non-copyable objects

2016-05-16 Thread Dimitry Sibiryakov
16.05.2016 13:04, Alex Peshkoff wrote: > Yes, please add that class to the tree. > I wanted to do it many times but wanted to clean old code and each time > something more urgent was present. Are you aware that with hack you won't be able to make copyable derived class even if you need one?

Re: [Firebird-devel] Non-copyable objects

2016-05-16 Thread Alex Peshkoff
On 05/15/2016 12:59 AM, Adriano dos Santos Fernandes wrote: > Hi! > > Instead of write private copy constructor and operator=, what about > start using a mixing at least for new code? > > It makes easier and much more clear. > > Example taken from >

Re: [Firebird-devel] Non-copyable objects

2016-05-16 Thread Dmitry Yemanov
16.05.2016 00:17, Dimitry Sibiryakov wrote: > > But for 4.0 official compiler is VS 2013 which support that. But we maintain projects for older VS versions too, and the code must be compilable with them. Dmitry --

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Dmitry Yemanov
15.05.2016 00:59, Adriano dos Santos Fernandes wrote: > > Instead of write private copy constructor and operator=, what about > start using a mixing at least for new code? > > It makes easier and much more clear. > > Example taken from >

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Adriano dos Santos Fernandes
Em 15/05/2016 18:27, Dimitry Sibiryakov escreveu: > 15.05.2016 23:21, Adriano dos Santos Fernandes wrote: >> Current compilers supports std library and we cannot use it, so because > it supports doesn't matter. > >"We don't use library X, so we cannot use language Y" you said. It is a > very

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Dimitry Sibiryakov
15.05.2016 23:21, Adriano dos Santos Fernandes wrote: > Current compilers supports std library and we cannot use it, so because it supports doesn't matter. "We don't use library X, so we cannot use language Y" you said. It is a very strange logic or I misunderstood you completely. Deleted

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Adriano dos Santos Fernandes
Em 15/05/2016 18:17, Dimitry Sibiryakov escreveu: > 15.05.2016 23:14, Adriano dos Santos Fernandes wrote: >> First, we do not use C++ version with this support. > >For 3.0 - yes. But for 4.0 official compiler is VS 2013 which support that. > Current compilers supports std library and we

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Dimitry Sibiryakov
15.05.2016 23:14, Adriano dos Santos Fernandes wrote: > First, we do not use C++ version with this support. For 3.0 - yes. But for 4.0 official compiler is VS 2013 which support that. -- WBR, SD. -- Mobile

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Adriano dos Santos Fernandes
Em 15/05/2016 08:15, Egor Pugin escreveu: > My vote is for explicit '= delete' solution too. Without any base > classes like NonCopyable. > Maybe sometimes you want allow copy init (clone members) and deny copy > assignment (deny following clones). > First, we do not use C++ version with this

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Egor Pugin
My vote is for explicit '= delete' solution too. Without any base classes like NonCopyable. Maybe sometimes you want allow copy init (clone members) and deny copy assignment (deny following clones). On 15 May 2016 at 13:17, Dimitry Sibiryakov wrote: > 14.05.2016 23:59,

Re: [Firebird-devel] Non-copyable objects

2016-05-15 Thread Dimitry Sibiryakov
14.05.2016 23:59, Adriano dos Santos Fernandes wrote: > Instead of write private copy constructor and operator=, what about > start using a mixing at least for new code? > > It makes easier and much more clear. Even easier and clearer explicitly deleted constructor and operator: Car(const

Re: [Firebird-devel] Non-copyable objects

2016-05-14 Thread Adriano dos Santos Fernandes
Em 14/05/2016 19:30, Egor Pugin escreveu: > If you set C++11 policy for FB v4, you can use deleted constructors. > It's method 3 from your link. > (There were some discussions about C++11 s in the ML.) It can be done in the NonCopyable class instead of every class, which is more simple, and a

Re: [Firebird-devel] Non-copyable objects

2016-05-14 Thread Egor Pugin
If you set C++11 policy for FB v4, you can use deleted constructors. It's method 3 from your link. (There were some discussions about C++11 s in the ML.) On 15 May 2016 at 00:59, Adriano dos Santos Fernandes wrote: > Hi! > > Instead of write private copy constructor and

[Firebird-devel] Non-copyable objects

2016-05-14 Thread Adriano dos Santos Fernandes
Hi! Instead of write private copy constructor and operator=, what about start using a mixing at least for new code? It makes easier and much more clear. Example taken from http://ariya.ofilabs.com/2015/01/c-class-and-preventing-object-copy.html class NonCopyable { protected: