Fix imperial cylinder sizes in equipment tab

Dirk Hohndel dirk at hohndel.org
Fri Jan 3 11:37:01 UTC 2014


On Fri, 2014-01-03 at 17:31 -0200, Thiago Macieira wrote:
> On sexta-feira, 3 de janeiro de 2014 08:54:32, Linus Torvalds wrote:
> > On Fri, Jan 3, 2014 at 4:31 AM, Thiago Macieira <thiago at macieira.org> wrote:
> > > If you want to pass a default argument of type pressure_t, then that
> > > struct
> > > requires a constructor for it to work in C++98.
> > 
> > Yeah, and that totally destroys the point of using "pressure_t" in the
> > first place (it's there purely for type safety, exactly so that you
> > can *not* use a plain integer by mistake).
> 
> Make the constructor explicit by adding the explicit keyword.

Time for me to learn something new. What does the explicit keyword
actually mean / do?

> > > However, C++11 does have a new feature called "uniform initialisation"
> > > which
> > > is probably what Linus is referring to. That would allow:
> > Yeah, also called "that's how they damn well should have done it in
> > the first place". The "uniform" is the fancy name for "oops, that's
> > how we do initializers in normal context, maybe we should do it the
> > same way here too".
> 
> Right, though they extended the syntax a little further too. You can write:
> 
> 	int x{0};
> 	QString y{QString()};
> 
> The second one also fixes one of the annoying things in the language: when a 
> statement looks like a function declaration, it is a function declaration, 
> even if most of the time you wanted to declare a variable. If you replace the 
> {} with () in there, it changes to a function declaration.
> 
> This also opened up for std::initializer_list, which allows us to now write:
> 
> 	QStringList z = {"a", "b", "c"};
> 

So are we going to switch to C++11? I'm open to it.

Thiago, are you sending patches?

/D



More information about the subsurface mailing list