Fix imperial cylinder sizes in equipment tab

Thiago Macieira thiago at macieira.org
Fri Jan 3 11:31:51 UTC 2014


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.

> > 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"};

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140103/c88708c5/attachment.sig>


More information about the subsurface mailing list