On 2/14/21 1:52 PM, Stephan Witt wrote:
Am 14.02.2021 um 19:33 schrieb Jean-Marc Lasgouttes <lasgout...@lyx.org>:
Le 14/02/2021 à 18:39, Stephan Witt a écrit :
So the attached patch helps. I’d like to apply it.
-       BufferView const * bv_;
+       BufferView const * bv_ = {};

I am a bit surpisez by these fluctoating notations. Am I right that it is the 
same to write:
BufferView const * bv_ {};
BufferView const * bv_ = {};
BufferView const * bv_ = {nullptr};
BufferView const * bv_ = nullptr;

Why do we need to have all these possibilities? In particular the first one is 
weird to me.

Is there a reason why initializing to {} eems better than initializing to 
nullptr? Isn't the later more explicit?
My first attempt was the 4th variant.

Yes, it’s a matter of style and I’m ok with this too.

Latest changes made me think it’s more modern to use the {} syntax.

The {} notation uses the default initializer, whatever that is. So, yes, nullptr would be more explicit but has the same effect.

See https://arne-mertz.de/2015/07/new-c-features-uniform-initialization-and-initializer_list/

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to