jeudi 28 janvier 2016

initializer lists with objects is non-portable?

I'm reading Mozilla's C++ portability guide where one of the advice states that:

Don't use initializer lists with objects

Non-portable example (at least, this used to be nonportable, because HP-UX!):

SubtlePoint myPoint = {300, 400};

This is more of a style thing at this point, but why not splurge and get yourself a nice constructor?

and I'm rather curious about this line "Non-portable example (at least, this used to be nonportable, because HP-UX!)". How come initializer lists are/were non-portable and in what sense? Are they safe to use now? And what does the term HP-UX refers to?

Aucun commentaire:

Enregistrer un commentaire