lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 4550: Avoid "using namespace std; " in included files (Take 2)


From: dak
Subject: Re: Issue 4550: Avoid "using namespace std; " in included files (Take 2) (issue 579240043 by address@hidden)
Date: Thu, 23 Jan 2020 06:39:36 -0800

On 2020/01/23 14:36:26, dak wrote:
> On 2020/01/23 12:43:34, lemzwerg wrote:
> > > Why is this ugly? std::string is really the name of the class.
> > 
> > No question, but I would prefer
> > 
> >   struct xxx {
> >     using std:string;
> > 
> >     string foo;
> >     string bar;
> >     string baz;
> >   }
> > }
> > 
> > to
> > 
> >   struct xxx {
> >     std::string foo;
> >     std::string bar;
> >     std::string baz;
> >   }
> > 
> > for example, to increase legibility if there are many strings.
> 
> In my book, local types _decrease_ legibility since they force you to
hunt
> around for the definition in order to know what one is actually
talking about.

But it's not actually an opinion contest.  The question is what use is
predominant in current C++ programming.  And most particularly in
_libraries_, one does not introduce arbitrary type aliases without very
good reason.

https://codereview.appspot.com/579240043/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]