On Fri, 22 Jan 2010 21:27:02 +0100, bearophile <[email protected]> wrote:

Thank you for your answers Simen kjaeraas.

No need for them when we have this: S s = S( 4 );<

If you have to initialize an array of many structs you have to repeat the name of the struct many times, this is redundant, and takes more space (and if you don't use an IDE it needs more time to type):

Use a local alias.

void foo( ) {
  alias StructWithHorriblyLongAndComplicatedName ຕ;
  auto s = [ ຕ( 1, "a" ), ຕ( 2, "b" ), ຕ( 3, "c" ) ];
}

--
Simen

Reply via email to